Skip to content

Fix flaky ObservableGrain_AsyncEnumerable_SlowConsumer test#9935

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:copilot/fix-flaky-observable-slowconsumer
Feb 17, 2026
Merged

Fix flaky ObservableGrain_AsyncEnumerable_SlowConsumer test#9935
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:copilot/fix-flaky-observable-slowconsumer

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Feb 17, 2026

Copy link
Copy Markdown
Member

Summary

  • fix timing race in ObservableGrain_AsyncEnumerable_SlowConsumer
  • track cleanup count captured before each MoveNext iteration
  • keep behavior coverage while avoiding accidental extra cleanup-cycle waits

Testing

  • dotnet test test/DefaultCluster.Tests/DefaultCluster.Tests.csproj --filter "FullyQualifiedName~ObservableGrain_AsyncEnumerable_SlowConsumer" -v q in a 20-iteration loop
Microsoft Reviewers: Open in CodeFlow

Capture cleanup count before each MoveNext cycle in ObservableGrain_AsyncEnumerable_SlowConsumer to avoid timer-alignment races that can wait an extra cleanup cycle and trigger enumerator eviction.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 17, 2026 00:51

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 addresses flakiness in the ObservableGrain_AsyncEnumerable_SlowConsumer test by removing a timing race around when the cleanup-cycle counter is sampled relative to each MoveNext iteration.

Changes:

  • Capture CleanupCount before each MoveNext iteration and use it to gate the “wait one cleanup cycle” delay.
  • Avoid accidental waiting for an extra cleanup cycle when cleanup completes immediately after MoveNext.

@ReubenBond ReubenBond enabled auto-merge February 17, 2026 00:57
@ReubenBond ReubenBond added this pull request to the merge queue Feb 17, 2026
Merged via the queue into dotnet:main with commit 198e626 Feb 17, 2026
65 checks passed
@ReubenBond ReubenBond deleted the copilot/fix-flaky-observable-slowconsumer branch February 17, 2026 02:15
rkargMsft pushed a commit to rkargMsft/orleans that referenced this pull request Feb 27, 2026
)

Fix flaky slow-consumer async enumerable test

Capture cleanup count before each MoveNext cycle in ObservableGrain_AsyncEnumerable_SlowConsumer to avoid timer-alignment races that can wait an extra cleanup cycle and trigger enumerator eviction.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 19, 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.

2 participants