Repository navigation
fix(testing): wait for async cleanup timer rearm - #10348
Merged
ReubenBond merged 3 commits intoAug 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes test flakiness in AsyncEnumerableGrainCallTests by making fake-time advances wait for the async-enumerator cleanup timer to be re-armed after each observed cleanup, ensuring subsequent fake-time advances don’t occur before the next one-shot timer tick is scheduled.
Changes:
- Track timer
Change(...)calls in aTrackingFakeTimeProviderwrapper aroundFakeTimeProvidertimers. - Capture the async-enumerable cleanup timer instance via diagnostics and expose it on the test listener.
- After each cleanup observation, wait for the corresponding timer re-arm (
ChangeCountincrement) before advancing time again.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.DefaultCluster.Tests/AsyncEnumerableGrainCallTests.cs | Adds fake-time timer rearm tracking and updates the async-enumerable cleanup advancement logic to wait for rearm deterministically. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
Track the cleanup grain timer's successful Change calls in the fake time provider and wait for rearm after each cleanup notification. This prevents a subsequent fake-time advance from racing the timer callback while preserving the eviction assertions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ReubenBond
force-pushed
the
reubenbond-stabilize-async-cleanup
branch
from
August 7, 2026 01:12
4c085dd to
a97af5e
Compare
Remove tracked fake-time timer entries during synchronous and asynchronous disposal so the collection fixture does not retain disposed grain timers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f882b77b-b8ac-433e-ae07-7d16dc531cbc
Move fake-time timer change tracking into shared timer test infrastructure and wait for self-disposing timers to be armed before advancing time. This closes the creation-event race which could miss the first one-shot tick. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f882b77b-b8ac-433e-ae07-7d16dc531cbc
This was referenced Aug 28, 2026
Merged
Merged
This was referenced Sep 3, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The async enumerable cleanup diagnostic is emitted before the grain timer callback returns and rearms its one-shot timer. A second fake-time advance could therefore occur too early and miss the next cleanup tick.
Track successful timer rearm operations in the test fake time provider and wait for the specific cleanup timer to rearm after each observed cleanup. This keeps the existing slow-consumer eviction assertions deterministic without changing production behavior or extending timeouts.