Skip to content

fix(testing): track reminder schedules per owner - #10312

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:reubenbond-fix-azure-reminder-churn
Jul 31, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:reubenbond-fix-azure-reminder-churn

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Jul 31, 2026

Copy link
Copy Markdown
Member

The Azure reminder churn test could stall until its five-minute cancellation when reminder ownership changed while fake time was paused. The reminder test observer aggregated scheduling state by grain and reminder, so an old owner's tick could consume the new owner's armed-wait signal and prevent further clock advancement.

Track tick attempts, armed waits, and schedule versions per local reminder owner instead. Clock advancement now waits until every active owner is armed, and ownership removal releases any newly satisfied waiter. Regression coverage models overlapping old and current owners during a handoff.

This fixes the test harness synchronization race without increasing timeouts or changing Azure Table reminder behavior.

Microsoft Reviewers: Open in CodeFlow

Track reminder scheduling readiness per local reminder instance so ownership handoffs cannot consume another owner's armed-wait signal. Add regression coverage for overlapping old and current owners.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4c73dfde-a01e-455d-8c3a-59b8e2803e1a
Copilot AI review requested due to automatic review settings July 31, 2026 19:04

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 fixes a synchronization race in the reminder diagnostics test harness where reminder ownership changes during paused fake time could cause clock advancement to stall until the overall test timeout. It does so by tracking schedule/arming state per local reminder owner instance (instead of aggregating per grain+reminder), ensuring that ticks from a previous owner cannot “consume” the current owner’s armed-wait signal.

Changes:

  • Track tick attempts, tick-wait arming counts, and schedule/arming versions per local reminder owner instance.
  • Require all active local owners to be armed before WaitForLocalReminderScheduleAsync completes, and re-check/release waiters on ownership removal.
  • Add a regression test which models overlap between previous and current owners during a handoff.
Show a summary per file
File Description
test/Orleans.Reminders.Tests/Diagnostics/ReminderEventsTests.cs Adds regression coverage for ownership handoff overlap ensuring schedule waits don’t stall.
src/Orleans.Testing.Reminders/ReminderDiagnosticObserver.cs Refactors scheduling readiness tracking to be per-owner-instance, fixing the waiter/tick-consumption race.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@ReubenBond ReubenBond changed the title Fix reminder test clock synchronization during ownership changes fix(testing): track reminder schedules per owner Jul 31, 2026
@ReubenBond
ReubenBond merged commit 26b60be into dotnet:main Jul 31, 2026
66 of 67 checks passed
@ReubenBond
ReubenBond deleted the reubenbond-fix-azure-reminder-churn branch July 31, 2026 20:27
This was referenced Aug 28, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 31, 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