Repository navigation
Fix the mail wake coordinator test's dropped cancellation event - #10344
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is a targeted, test-only synchronization fix that deterministically preserves the intended event recording behavior and aligns with the PR’s documented failure mode.
Pull request overview
This PR stabilizes an intermittently failing Nitro.CommandLine.Tests test by ensuring a cancellation callback event is reliably recorded before the callback registration is disposed, preventing flaky event-order assertions in CI runs.
Changes:
- Update
DeniedThenHangingDispatcherto coordinate cancellation callback execution via aTaskCompletionSource. - Ensure the fake dispatcher does not return until its
CancellationToken.Registercallback has run and recorded the expected event.
File summaries
| File | Description |
|---|---|
| src/Nitro/CommandLine/test/CommandLine.Tests/Services/Notify/MailWakeDaemonCoordinatorTests.cs | Makes the dispatcher fake wait for its cancellation callback to run before disposing the registration, removing a source of flaky event ordering. |
Review details
- Files reviewed: 1/1 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.
Contributor
|
✅ Nitro CLI E2E snapshots: no flow recordings changed vs |
This was referenced Oct 25, 2026
Merged
This was referenced Nov 1, 2026
This was referenced Nov 16, 2026
fix(deps): Bump Basic.Reference.Assemblies.Net100 and 32 others
AdCodicem/AdCodicem.ValueObjects#262
Closed
This was referenced Nov 23, 2026
fix(deps): Bump Basic.Reference.Assemblies.Net100 and 43 others
AdCodicem/AdCodicem.ValueObjects#274
Closed
This was referenced Nov 30, 2026
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.
Summary
MailWakeDaemonCoordinatorTests.RunningLeader_Should_ReleaseLeadership_And_CancelSiblings_When_AccessDeniedReleaseIsBusyintermittently failed in CI (for example run 33753963774, net11.0 with--coverage) withExpected "hung-actor-cancelled" before "release-attempted". Events: [release-attempted, release-attempted].DeniedThenHangingDispatcherfake recorded that event from aCancellationToken.Registercallback held byawait using, then awaited an infiniteTask.Delayon the same token. Callbacks run in LIFO order, soTask.Delay's later registration fired first, the method unwound, and disposing the registration unregistered the fake's callback before it had run.TaskCompletionSource, and the fake awaits it before returning, so the registration is disposed only after the event is recorded.MailWakeDaemonCoordinatoris unchanged; it already awaitsCancelAsyncbefore releasing the lease.Test plan
Nitro.CommandLine.Testsfor net11.0 withCI_BUILD=trueand ran the single test 40 times with--coverageunder 24 busy-loop processes: 40 passes. The same setup reproduced the failure without the change.Nitro.CommandLine.Testssuite on net11.0: 3599 passed, 0 failed.