Repository navigation
[test-quarantine] Stabilize the NavigationLock overlapping navigation E2E test - #68267
Merged
Merged
Conversation
added 3 commits
August 4, 2026 13:31
…ts.ServerRoutingTest.NavigationLock_OverlappingNavigationsCancelExistingNavigations_HistoryNavigation
…ts.ServerRoutingTest.NavigationLock_OverlappingNavigationsCancelExistingNavigations_HistoryNavigation
…ts.ServerRoutingTest.NavigationLock_OverlappingNavigationsCancelExistingNavigations_HistoryNavigation
Contributor
|
Thanks for your PR, @Vinoth2562000. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Vinoth2562000
marked this pull request as ready for review
August 20, 2026 11:20
Contributor
There was a problem hiding this comment.
Pull request overview
Stabilizes the Blazor E2E test ServerRoutingTest.NavigationLock_OverlappingNavigationsCancelExistingNavigations_HistoryNavigation by eliminating a race between enabling NavigationLock’s internal-navigation blocking and triggering browser history navigation in the test.
Changes:
- Adds a browser-side “ready” acknowledgement to the
ConfigurableNavigationLocktest component via a hidden input updated after render using JS interop. - Updates the E2E test to wait for the readiness signal before calling
Browser.Navigate().Back(). - Removes the quarantine attribute from the server-execution subclass now that the flake is addressed.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Components/test/testassets/BasicTestApp/RouterTest/ConfigurableNavigationLock.razor | Adds JS interop + hidden readiness element updated after render when internal blocking is toggled. |
| src/Components/test/E2ETest/Tests/RoutingTest.cs | Waits for the readiness signal before performing history navigation to avoid the observed race. |
| src/Components/test/E2ETest/ServerExecutionTests/TestSubclasses.cs | Un-quarantines the server-execution override for the stabilized test. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
kotlarmilos
reviewed
Aug 20, 2026
…er 30 days of successful runs Show more lines
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.
Quarantine Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests.ServerRoutingTest.NavigationLock_OverlappingNavigationsCancelExistingNavigations_HistoryNavigation
Description
This fixes the intermittent failure in
NavigationLock_OverlappingNavigationsCancelExistingNavigations_HistoryNavigation.The test failed primarily in the Blazor Server execution variant when browser history navigation started before the browser had finished registering the location-changing listener.
Root cause
Enabling internal navigation blocking causes NavigationLock to register its location-changing handler during OnAfterRenderAsync.
For Blazor Server, the browser-side listener is enabled through an asynchronous JS interop call. The test could call Browser.Navigate().Back() before the browser processed that call. The resulting popstate event bypassed the navigation lock, causing the test to observe an unexpected URI or fail to find the blocking controls.
Waiting after Browser.Navigate().Back() did not close the race because the history navigation could already have bypassed the lock.
Fix
Add a browser-side readiness acknowledgement to the test component and wait for it before starting history navigation:
The original navigation behavior and assertions are preserved. The test still verifies that overlapping history navigations cancel the existing navigation, log the cancellation, and continue to the expected URI.
Validation
Ran the test 100 consecutive times, and the test case passed successfully every time.
Fixes #61080 #65961