Skip to content

Use a controlled external origin in redirection tests - #68782

Merged
ilonatommy merged 3 commits into
mainfrom
fix-redirection-test-controlled-origin
Aug 26, 2026
Merged

Use a controlled external origin in redirection tests#68782
ilonatommy merged 3 commits into
mainfrom
fix-redirection-test-controlled-origin

Conversation

@ilonatommy

Copy link
Copy Markdown
Member

Summary

  • Add a test-owned server on a second ephemeral origin for external redirection tests.
  • Configure component and non-Blazor redirect paths to use the controlled destination.
  • Assert the exact destination URI and a marker from the loaded document.
  • Unquarantine the seven external RedirectionTest variants.

Motivation

The tests previously redirected to microsoft.com and 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.

RedirectStreamingEnhancedPostToExternal tested 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

@ilonatommy
ilonatommy requested review from maraf and oroztocil August 25, 2026 11:39
@ilonatommy ilonatommy self-assigned this Aug 25, 2026
@ilonatommy ilonatommy added the area-blazor Includes: Blazor, Razor Components label Aug 25, 2026
@ilonatommy
ilonatommy marked this pull request as ready for review August 25, 2026 12:40
@ilonatommy
ilonatommy requested a review from a team as a code owner August 25, 2026 12:40
Copilot AI lite review requested due to automatic review settings August 25, 2026 12:40
@ilonatommy
ilonatommy enabled auto-merge (squash) August 25, 2026 12:41
@ilonatommy ilonatommy added this to the 12.0-preview1 milestone Aug 25, 2026

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.

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.
@ilonatommy

Copy link
Copy Markdown
Member Author

/ba-g failures not connected

@ilonatommy
ilonatommy merged commit 133b116 into main Aug 26, 2026
27 of 29 checks passed
@ilonatommy
ilonatommy deleted the fix-redirection-test-controlled-origin branch August 26, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components feature-blazor-navigation

Projects

None yet

3 participants