Stabilize async enumerable slow consumer tests#10101
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR stabilizes AsyncEnumerableGrainCallTests slow-consumer scenarios by eliminating reliance on wall-clock delays and instead driving async-enumerator cleanup deterministically using a fake TimeProvider in a dedicated test cluster fixture.
Changes:
- Moved
AsyncEnumerableGrainCallTestsonto a dedicated xUnit collection +BaseTestClusterFixturewhich installs aFakeTimeProviderinto the silo DI container. - Reworked slow-consumer tests to advance fake time and wait for cleanup diagnostics instead of using
Task.Delayloops and modifying the extension timer. - Updated the eviction test to explicitly advance through two cleanup passes to preserve the “abandoned enumerator is evicted” assertion.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.DefaultCluster.Tests/Orleans.DefaultCluster.Tests.csproj | Adds the fake time provider testing package needed to drive deterministic cleanup in tests. |
| test/Orleans.DefaultCluster.Tests/AsyncEnumerableGrainCallTests.cs | Introduces a fake-time cluster fixture and updates slow-consumer/eviction tests to advance time and observe cleanup deterministically via diagnostics. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
Use a FakeTimeProvider-backed fixture for AsyncEnumerableGrainCallTests so slow-consumer cleanup can be advanced deterministically instead of relying on wall-clock polling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Switch the fake-time async enumerable test fixture from TestClusterBuilder to InProcessTestClusterBuilder while keeping deterministic cleanup advancement. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5625e85 to
ff4bc5d
Compare
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.
ObservableGrain_AsyncEnumerable_SlowConsumer could allow multiple cleanup passes to elapse while waiting on wall-clock time. Under CI load, that could remove the enumerator and surface EnumerationAbortedException even though the test is meant to prove one cleanup pass is safe.
This PR moves AsyncEnumerableGrainCallTests to a dedicated in-process fake-time cluster fixture and advances the silo TimeProvider to drive cleanup deterministically. The listener now only observes cleanup diagnostics instead of changing the extension timer, and the eviction test advances through two cleanup passes to preserve its abandoned-enumerator assertion.
Fixes: #10079