test(grain-directory): make shutdown migration deterministic - #10610
Merged
ReubenBond merged 1 commit intoAug 17, 2026
Merged
Conversation
Force the migration path to reject a placement hint targeting the shutting-down source silo, so stale placement candidates reproduce state loss deterministically instead of probabilistically. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the grain directory shutdown migration integration test to deterministically validate that a shutting-down source silo is excluded from migration placement candidates, preventing intermittent passes/failures caused by probabilistic fallback placement.
Changes:
- Replace
MigrateOnIdle()duringShuttingDowndeactivation with an explicitGrainContext.Migrate(...)call supplying a placement hint targeting the source silo. - Ensure the test deterministically fails if placement incorrectly re-admits the shutting-down source (by honoring the hint and skipping migration).
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.GrainDirectory.Tests/GrainDirectory/GrainDirectoryShutdownMigrationTests.cs | Makes shutdown migration test deterministic by initiating migration with an explicit placement hint targeting the shutting-down source silo. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
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.
Problem
The shutdown migration regression depended on random fallback placement after the local silo entered ShuttingDown. If stale compatibility data still included the source silo, PreferLocalPlacement only selected it probabilistically, so the test could pass despite the state-loss defect or fail intermittently with reactivated default state.
The production synchronization fix is now covered by #10596, #10597, and #10599, but the integration test did not deterministically prove that the shutting-down source is excluded from migration candidates.
Solution
Initiate shutdown migration with an explicit placement hint targeting the source silo. Correct placement rejects that hint because the source is no longer compatible and migrates to the surviving silo. A regression which re-admits the source honors the hint, skips migration, and deterministically reproduces the lost state (42 becoming
Microsoft Reviewers: Open in CodeFlow