test(zookeeper): make close ordering assertion deterministic - #11347
ReubenBond wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The revised assertion correctly verifies ordering without relying on a scheduling barrier.
Review effort: Lite
Findings: None
What changed in this PR
Makes the ZooKeeper close-ordering test deterministic by recording native request completion at close entry.
Changes:
- Removes the racy intermediate
closeStartedassertion. - Verifies the native completion notification preceded close initiation.
| File | Description |
|---|---|
test/Extensions/Orleans.Clustering.ZooKeeper.Tests/ZooKeeperReadRetryTests.cs |
Updates close-ordering assertions in the ZooKeeper retry test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code coverage
Report-only conclusion: improved. The current-main baseline is commit Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities. The comparison remains report-only while normal line and branch variance is calibrated. Coverage details |
Problem
ReadOwner_CanceledCaller_JoinsNativeTasksBeforeClosetreated the fake native request'sAfterRequestnotification as a scheduling barrier. Once that notification fires, the operation owner can legitimately begin closing before the test continuation resumes, making the intermediatecloseStartedassertion flaky.Change
Capture at close entry whether the native request completion notification has already occurred, then assert that recorded ordering after observing close start. This deterministically verifies that the owner joins the admitted native request before close while preserving the cancellation-token, no-second-read, and close-completion lifecycle checks.
Closes #11346
Microsoft Reviewers: Open in CodeFlow