Repository navigation
[blazor] Stabilize navigation lock cancellation test - #70829
Merged
Merged
Conversation
…on_ThenCancel On Blazor Server, NavigationLock registers its location-changing handler in OnAfterRenderAsync, which runs only after the client acknowledges the render batch. Navigating immediately after clicking the second lock's checkbox could reach the server before that handler was registered. Wait for the existing navigation-lock-ready signal, as the sibling ThenContinue test already does. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the change adding readiness waits to the navigation-lock cancellation test.
No open issues 🎉
What changed in this PR
Stabilizes the Blazor navigation-lock cancellation E2E test by waiting for both locks to report readiness before navigating, addressing a possible handler-registration race.
Changes:
- Adds readiness waits for both navigation locks, matching the neighboring continue test.
- Preserves the two-lock cancellation scenario and all existing assertions.
| File | Description |
|---|---|
| src/Components/test/E2ETest/Tests/RoutingTest.cs | Waits for both navigation locks to become ready before testing cancellation. |
Review effort: Balanced
Member
|
/review |
dariatiurina
approved these changes
Nov 26, 2026
maraf
temporarily deployed
to
copilot-pat-pool
November 26, 2026 14:34 — with
GitHub Actions
Inactive
maraf
temporarily deployed
to
copilot-pat-pool
November 26, 2026 14:34 — with
GitHub Actions
Inactive
maraf
temporarily deployed
to
copilot-pat-pool
November 26, 2026 14:35 — with
GitHub Actions
Inactive
maraf
temporarily deployed
to
copilot-pat-pool
November 26, 2026 14:37 — with
GitHub Actions
Inactive
maraf
temporarily deployed
to
copilot-pat-pool
November 26, 2026 14:38 — with
GitHub Actions
Inactive
maraf
temporarily deployed
to
copilot-pat-pool
November 26, 2026 14:39 — with
GitHub Actions
Inactive
Contributor
|
✅ No documentation PR was created. Confidence that documentation is needed: 2% No docs needed: the PR only stabilizes an E2E test (tests/test infrastructure category). Documentation surfaces considered
|
maraf
temporarily deployed
to
copilot-pat-pool
November 26, 2026 14:39 — with
GitHub Actions
Inactive
This branch was previously deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
d99ea43e75e452eb50d181b782f331b91617630d↓ Linux Chrome container behavior has not been checked.
↓ The registration race was not instrumented directly.
↓ The precise timing in the CI failure was not observed.
[blazor] Stabilize navigation lock cancellation test
Wait for both navigation locks to become ready before navigating.
Description
Wait for each existing
navigation-lock-readysignal before starting the navigation, as the neighboring continue test already does. This preserves the two-lock cancellation scenario and all existing assertions. The change addresses a possible race between navigation and registration of the second handler.The failure was observed in CI build 1697387 for #70526. No associated issue.
Validation on macOS with Chrome, after
source activate.sh:dotnet build src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj --no-restore -v:q -p:UseIisNativeAssets=false— passed.dotnet test src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj --no-build --filter "FullyQualifiedName~NavigationLock_CanBlockNavigation_Then"— passed all four Server and WebAssembly cases.dotnet test src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj --no-build --filter "FullyQualifiedName~ServerRoutingTest.NavigationLock_CanBlockNavigation_ThenCancel"— passed 24 repeated runs after the change; the original failed twice in 16 runs, with one captured failure matching the CI assertion../eng/build.sh— failed on aGetFilesToPublishcircular dependency inMicrosoft.AspNetCore.App.Runtime.sfxproj; the targeted project subsequently built successfully.Linux Chrome container CI was not run locally.
Note
This PR description was generated with the assistance of GitHub Copilot.