Skip to content

fix(tests): de-flake grouping E2E against interleaved incident lines#375

Merged
mostafa merged 1 commit into
mainfrom
fix/grouping-test-interleaved-incident-line
Jul 22, 2026
Merged

fix(tests): de-flake grouping E2E against interleaved incident lines#375
mostafa merged 1 commit into
mainfrom
fix/grouping-test-interleaved-incident-line

Conversation

@mostafa

@mostafa mostafa commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • grouping_annotates_incident_id_and_exposes_open_incidents posts two detections that group into one incident and asserts the first two file-sink lines are both pass-through detections carrying enrichments.incident_id.
  • With group_wait: 0s, the daemon's 1s alert tick emits a group_wait incident to the same file sink. That line carries a top-level incident_id (not one under enrichments) and can interleave between the two detections, so lines[1] was sometimes the incident line, tripping second detection must carry incident_id.
  • The test now selects file lines by their enrichments.incident_id annotation, so the assertion no longer depends on incident-emission ordering. Test-only change; daemon behavior is unchanged.

Test plan

  • cargo test -p rsigma-cli --features daemon --test cli_daemon_alert_pipeline (all 5 pass)
  • Ran grouping_annotates_incident_id_and_exposes_open_incidents 5 times in a row with no failures
  • cargo fmt --all -- --check

The grouping alert-pipeline test posts two detections that group into one
incident and asserts both pass-through lines carry the same incident_id.
Because group_wait is 0s, the 1s alert tick also emits a group_wait
incident to the same file sink; that line carries a top-level incident_id
rather than one under enrichments and can interleave between the two
detections. Selecting file lines by the enrichments.incident_id annotation
makes the assertion independent of incident-emission ordering.
@mostafa
mostafa merged commit e54c0e4 into main Jul 22, 2026
14 checks passed
@mostafa
mostafa deleted the fix/grouping-test-interleaved-incident-line branch July 22, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant