Skip to content

Stabilize async enumerable slow consumer tests#10101

Merged
ReubenBond merged 2 commits into
mainfrom
reubenbond/flaky-async-enumerable-test
May 14, 2026
Merged

Stabilize async enumerable slow consumer tests#10101
ReubenBond merged 2 commits into
mainfrom
reubenbond/flaky-async-enumerable-test

Conversation

@ReubenBond

@ReubenBond ReubenBond commented May 14, 2026

Copy link
Copy Markdown
Member

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AsyncEnumerableGrainCallTests onto a dedicated xUnit collection + BaseTestClusterFixture which installs a FakeTimeProvider into the silo DI container.
  • Reworked slow-consumer tests to advance fake time and wait for cleanup diagnostics instead of using Task.Delay loops 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

Comment thread test/Orleans.DefaultCluster.Tests/AsyncEnumerableGrainCallTests.cs
ReubenBond and others added 2 commits May 14, 2026 11:18
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>
@ReubenBond ReubenBond force-pushed the reubenbond/flaky-async-enumerable-test branch from 5625e85 to ff4bc5d Compare May 14, 2026 18:18
@ReubenBond ReubenBond added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit 3d0da79 May 14, 2026
118 of 119 checks passed
@ReubenBond ReubenBond deleted the reubenbond/flaky-async-enumerable-test branch May 14, 2026 20:01
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: AsyncEnumerableGrainCallTests.ObservableGrain_AsyncEnumerable_SlowConsumer

2 participants