GeezerVison is showing github.com — fix(test): remove placement timeout race by ReubenBond · Pull Request #10898 · dotnet/orleans
Conversation
ReubenBond
commented
Aug 28, 2026
•
edited by dotnet-policy-service
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem
GetOrPlaceActivationAsync_WhenLookupDoesNotComplete_TimesOut advances 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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.Same with placementTask.WaitAsync(TestContext.Current.CancellationToken) inside Assert.ThrowsAsync<TimeoutException>.
- Keeps the existing assertions on the
TimeoutException and its Polly.Timeout.TimeoutRejectedException inner 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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 29, 2026
This was referenced Sep 7, 2026
This was referenced Sep 9, 2026
This was referenced Sep 16, 2026
This was referenced Sep 23, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.