Skip to content

Fix flaky Messages_Not_Dispatched_After_Cancellation test#2043

Open
slang25 wants to merge 2 commits intomainfrom
slang25/fix-flaky-tests
Open

Fix flaky Messages_Not_Dispatched_After_Cancellation test#2043
slang25 wants to merge 2 commits intomainfrom
slang25/fix-flaky-tests

Conversation

@slang25
Copy link
Copy Markdown
Member

@slang25 slang25 commented Apr 7, 2026

Relax the strict zero-tolerance assertion in Messages_Not_Dispatched_After_Cancellation to allow up to 2 in-flight dispatches after cancellation. Multiple concurrent MultiplexerSubscriber tasks can pass the ThrowIfCancellationRequested() check before Cancel() is observed, creating a legitimate race window. This matches the tolerance pattern already used in the sibling test Sqs_Queue_Is_Not_Polled_After_Cancellation.

The test strictly asserted zero dispatches after cancellation, but multiple
concurrent MultiplexerSubscriber tasks can pass the cancellation check before
Cancel() is observed, creating a legitimate race window. Relax the assertion
to allow a small number of in-flight dispatches, matching the tolerance
pattern used in Sqs_Queue_Is_Not_Polled_After_Cancellation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@slang25 slang25 requested a review from a team as a code owner April 7, 2026 13:07
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.12%. Comparing base (21db9c6) to head (65c7b1a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2043   +/-   ##
=======================================
  Coverage   78.12%   78.12%           
=======================================
  Files         149      149           
  Lines        3895     3895           
  Branches      646      646           
=======================================
  Hits         3043     3043           
  Misses        555      555           
  Partials      297      297           
Flag Coverage Δ
linux 78.07% <ø> (ø)
macos 61.57% <ø> (ø)
windows 61.51% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…ing test

Relax the exact-count assertion to an upper-bound check. The buffer
may not fully fill within the 150ms cancellation window, but should
never exceed the expected download count (which would indicate the
stop-downloading logic is broken). This matches the tolerance approach
used in the other flaky test fixes in this branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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