Skip to content

Stabilize the Blazor circuit reconnect test - #70744

Open
BrundhaVelusamy wants to merge 5 commits into
dotnet:mainfrom
BrundhaVelusamy:70699_TestFailure
Open

BrundhaVelusamy wants to merge 5 commits into
dotnet:mainfrom
BrundhaVelusamy:70699_TestFailure

Conversation

@BrundhaVelusamy

Copy link
Copy Markdown
Contributor

Description

Connect_WhilePersistingEvictedCircuit_IsInProgress started disconnect and reconnect concurrently without enforcing their order. If reconnect ran first, the registry could legitimately transfer the still-active circuit to the new connection. The test then failed because it expected the connected registry to be empty.

The test now waits for eviction to reach the persistence provider and holds persistence open during the reconnect attempt. It verifies that reconnect returns null and that the circuit is absent from both registries. No production code changed.

Validation

  • Original Linux Helix failure (build 1686243): Assert.Empty() found a circuit connected as new-connection.

  • On Windows, an in-process stress run reproduced the same assertion on iteration 2 before the fix. After the fix, all 100 iterations passed.

  • All 20 CircuitRegistryTest tests passed on Windows. Linux Helix was not rerun.

Before:
image

After
image

Fixes: #70699

Wait for eviction to reach the persistence provider before attempting
reconnect, and keep persistence pending until the attempt completes.
@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Nov 20, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 20, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @BrundhaVelusamy. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@BrundhaVelusamy
BrundhaVelusamy marked this pull request as ready for review November 20, 2026 10:23
@BrundhaVelusamy
BrundhaVelusamy requested a review from a team as a code owner November 20, 2026 10:23
Copilot AI balanced review requested due to automatic review settings November 20, 2026 10:23

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.

🟢 Approval recommended

No active review issues block the test-only change that explicitly orders circuit eviction and reconnection.

No open issues 🎉

What changed in this PR

Stabilizes the Blazor Server circuit reconnect test for #70699 by explicitly ordering eviction and reconnection, rather than relying on concurrent scheduling. No production code changes.

Changes:

  • Adds a provider-entry signal so reconnect runs while persistence is paused.
  • Verifies reconnect returns null and the circuit is absent from both registries.
  • Adds bounded waits, releases persistence in finally, and asserts persistence completion.
File Description
src/​Components/​Server/​test/​Circuits/​CircuitRegistryTest.cs Coordinates eviction, persistence, and reconnect with explicit signals and strengthens assertions.

Review effort: Balanced

@PureWeen

Copy link
Copy Markdown
Member

/review

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.

🟢 Approval recommended

There are no active review issues for the test-only change coordinating circuit persistence and reconnect.

No open issues 🎉

Review effort: Balanced

@PureWeen

Copy link
Copy Markdown
Member

Copilot's local review panel found no issues to raise at this commit.

Informational checks (non-blocking): The panel examined and discarded concerns about disconnect/persistence sequencing, reconnect timing, cleanup gate release, bounded waits, and the permanent test layer. No unresolved candidate remained, and no candidate reached the verifier because the provisional finding set was empty.

Posted for informational purposes so the author can confirm the verifier didn't discard or leave unresolved a real finding; this item does not block agent-reviewed-approved.

Untested coverage gap: No arm completed runtime or browser validation. Two arms were source-only; one scoped test attempt was blocked by incomplete restored build infrastructure (NETSDK1226, then a missing GenerateFiles import).

Validation boundary: Source review of the frozen diff and owning CircuitRegistry paths; no successful local build, test, or browser execution.

@kotlarmilos

Copy link
Copy Markdown
Member

Please keep this limited to stabilizing the existing reconnect test. Use the smallest synchronization change needed to ensure eviction happens before reconnecting, and avoid expanding the test scenario.

@BrundhaVelusamy

Copy link
Copy Markdown
Contributor Author

Please keep this limited to stabilizing the existing reconnect test. Use the smallest synchronization change needed to ensure eviction happens before reconnecting, and avoid expanding the test scenario.

@kotlarmilos, Thanks for the guidance. I reviewed the current PR diff and confirmed that it already follows this direction:

  • The change is limited to the existing reconnect test.
  • It uses a single test-only synchronization point in the existing persistence provider.
  • Reconnect is attempted only after eviction has entered the persistence path.
  • The existing reconnect-failure assertions are preserved.
  • No production code or additional test scenario is included.

No further changes were made based on this comment. The focused test and all 20 CircuitRegistryTest tests pass on Windows.

This branch was previously deployed

1 inactive (outdated) deployment
copilot-pat-pool — dab09391 Deployed Nov 20, 2026 by dotnet-policy-service[bot] via pat_pool #2692
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-reviewed-approved area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flakiness] CircuitRegistry reconnect leaves an evicted circuit registered

4 participants