fix(tests): patch the legacy status to a status different from the current one (#18325) - #18327
Merged
Xavier Fournet (xfournet) merged 1 commit intoSep 17, 2026
Merged
Conversation
…rrent one (#18325) Since the workflow publication creates a Status per state, the Report statuses hold two entries with the same `order` (the legacy NEW and the workflow's `validated`), and the status cache sorts by `order` only. The positional pick `statuses[1]` therefore landed on the report's current status or not depending on the Elasticsearch tie-break: no write and no stream event in the first case, one event in the second, and the raw stream test failed on one run out of three with 16 report updates instead of the 15 that had been recorded from a run of the first kind. Pick a status explicitly different from the report's current one, so the patch always changes the status and always emits its event, and record the deterministic count of 16.
Copilot started reviewing on behalf of
Xavier Fournet (xfournet)
September 17, 2026 12:38
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified.
Pull request overview
This pull request stabilizes workflow integration tests by ensuring the legacy status patch always changes the report status.
Changes:
- Selects a status different from the current status.
- Restores the expected report update count to 16.
File summaries
| File | Summary |
|---|---|
opencti-platform/opencti-graphql/tests/utils/syncCountHelper.ts |
Updates the expected report event count. |
opencti-platform/opencti-graphql/tests/03-integration/02-resolvers/workflow-test.ts |
Ensures the legacy status patch uses a non-current status. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18327 +/- ##
==========================================
+ Coverage 28.13% 36.37% +8.23%
==========================================
Files 3467 3467
Lines 141015 141015
Branches 38072 38072
==========================================
+ Hits 39679 51294 +11615
+ Misses 101336 89721 -11615
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Xavier Fournet (xfournet)
deleted the
issue/18325-raw-stream-status-tie
branch
September 17, 2026 18:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
workflow-test.ts, the legacy-status test patches the report to a status explicitly different from its current one, read through the API, instead of the positionalstatuses[1]. Since feat(workflow): Make workflow publish create/resolve Status #17898 the Report statuses hold two entries with the sameorder(the legacyNEWand the workflow'svalidated), the status cache sorts byorderonly, and the positional pick landed on the current status or not depending on the Elasticsearch tie-break: no write and no stream event in one case, one event in the other.syncCountHelper.ts, the expected count of report update events goes back to 16: the patch now always changes the status and always emits its event. The 15 recorded by feat(workflow): Make workflow publish create/resolve Status #17898 came from a run where the coin had landed onNEW.Related issues
How to test this PR
The failure showed on roughly one backend integration run out of three since 2026-09-16 (
c46f7b4405,8e8fd7058e,35809ac25fon master, #18236, #18316, #18267, #18323 on pull requests), always as:with the extra event being the
workflow_idreplace onLegacy Status Patch Test Report. With this change the event is emitted on every run, so the CI integration job is the test: several green runs in a row, where the previous state gave a red one every three.Nothing runs locally for this: the raw stream test needs the full CI stack (platform, worker, Redis stream).
Checklist
Further comments
findByTypereads Elasticsearch directly; it reads the status cache of the test-runner process. Replaced by the explanation of the pick.ordervalues computed at publication (0, 1, 2, …) collide with those of the legacy statuses of the same type (1, 2, 3, 4), and the status cache sort has no secondary key, so the relative order of two statuses with the sameorderis undefined in the product as well.🤖 Generated with Claude Code