fix(test): remove placement timeout race - #10898
Merged
ReubenBond merged 1 commit intoAug 28, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Lite
Findings: None
What changed in this PR
Removes a timing-sensitive race in an Orleans runtime placement timeout unit test by switching from a Task.WhenAny(..., Task.Delay(...)) wall-clock gate to awaiting the placement task directly with xUnit’s cancellation token, aligning the test with how timeouts are driven via FakeTimeProvider.
Changes:
- Replaces
Task.WhenAny(placementTask, Task.Delay(1s))+Assert.SamewithplacementTask.WaitAsync(TestContext.Current.CancellationToken)insideAssert.ThrowsAsync<TimeoutException>. - Keeps the existing assertions on the
TimeoutExceptionand itsPolly.Timeout.TimeoutRejectedExceptioninner exception.
| File | Description |
|---|---|
| test/Orleans.Core.Tests/Runtime/PlacementServiceTests.cs | Updates the flaky timeout test to avoid a wall-clock scheduling race while still keeping the await bounded by the test runner’s cancellation token. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Aug 29, 2026
Merged
This was referenced Sep 7, 2026
This was referenced Sep 9, 2026
Closed
Closed
This was referenced Sep 16, 2026
Open
Open
Merged
This was referenced Sep 23, 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.
Problem
GetOrPlaceActivationAsync_WhenLookupDoesNotComplete_TimesOutadvances its fake clock to fire the placement timeout, then requires the resulting asynchronous cancellation propagation to complete within one second of wall-clock time. Under the loaded Windows BVT process, that continuation can be delayed long enough for the real-time delay to win even though the timeout has fired correctly.Solution
Await the placement task directly using the xUnit cancellation token and assert its timeout outcome. This preserves a bounded test while removing the scheduler race between the placement continuation and an unrelated wall-clock delay.
Fixes #10852
Microsoft Reviewers: Open in CodeFlow