Use a controlled external origin in redirection tests - #68782
Merged
Conversation
maraf
approved these changes
Aug 25, 2026
ilonatommy
marked this pull request as ready for review
August 25, 2026 12:40
ilonatommy
enabled auto-merge (squash)
August 25, 2026 12:41
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Components E2E redirection tests to stop using microsoft.com as the external destination, replacing it with a test-owned second ephemeral origin to preserve cross-origin behavior while removing public network/page-load timing dependencies (addressing flakiness across multiple RedirectionTest variants).
Changes:
- Add a dedicated external-origin test server (
ExternalNavigationStartup) and plumb its URI into the main test server via configuration. - Update redirecting components/endpoints to navigate to the controlled external origin (including query-string behavior).
- Strengthen E2E assertions to validate the exact destination URI and confirm the external document is loaded (marker element), and unquarantine the external redirect variants.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Redirections/RedirectStreamingPost.razor | Uses configured external navigation target instead of hard-coded microsoft.com. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Redirections/RedirectStreamingGet.razor | Uses configured external navigation target instead of hard-coded microsoft.com. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Redirections/RedirectPost.razor | Uses configured external navigation target instead of hard-coded microsoft.com. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Redirections/RedirectGet.razor | Uses configured external navigation target instead of hard-coded microsoft.com. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Redirections/ExternalNavigationTarget.cs | New DI service that reads the external target URI from configuration and constructs a stable “URI + query” value. |
| src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs | Registers ExternalNavigationTarget and routes non-Blazor external redirects to the controlled target. |
| src/Components/test/testassets/Components.TestServer/ExternalNavigationStartup.cs | New minimal external-origin server that serves a marker element to assert page-load completion. |
| src/Components/test/E2ETest/ServerRenderingTests/RedirectionTest.cs | Starts a second-origin server fixture, configures the main server to redirect to it, improves assertions, and unquarantines external variants. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Removed warning suppression for ASP0029 in RazorComponentEndpointsStartup.cs.
maraf
approved these changes
Aug 25, 2026
Member
Author
|
/ba-g failures not connected |
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.
Summary
RedirectionTestvariants.Motivation
The tests previously redirected to
microsoft.comand completed as soon as the browser URL contained that hostname. Because the Selenium browser is reused between theory rows, the external document could still be loading when the next row initialized. The next WebDriver command could then time out while reading the browser window size.A test-owned second origin preserves the cross-origin behavior while removing dependencies on public DNS, TLS, CDN, redirects, and page-load timing.
RedirectStreamingEnhancedPostToExternaltested locally:before the fix: 2/20
after the fix: 0/80
https://dev.azure.com/dnceng-public/public/_test/analytics?definitionId=87&contextType=build
Fixes #66969
Fixes #67342
Fixes #67738
Fixes #67444
Fixes #66969