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

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

Copy link
Copy Markdown
Member Author

/backport to release/11.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0 (link to workflow run)

wtgodbe pushed a commit that referenced this pull request Sep 21, 2026
wtgodbe added a commit that referenced this pull request Sep 22, 2026
* [release/11.0] Update Blazor WASM service defaults to OpenTelemetry 1.19 (#69401)

* Update Blazor WASM service defaults to OpenTelemetry 1.19

Remove the browser OTLP export workaround and its resilience dependency now that the exporter avoids IHttpClientFactory integration on browser platforms.

Fixes #69400

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 1fb0cde9-afea-4acd-924d-2d5ebcb29be4

* Update remaining OpenTelemetry packages to 1.19

Remove the stale HTTP resilience template substitution now that the Blazor WebAssembly workaround no longer consumes it.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 1fb0cde9-afea-4acd-924d-2d5ebcb29be4

* Update eng/Versions.props

Co-authored-by: Martin Costello <[email protected]>

---------

Co-authored-by: Martin Costello <[email protected]>
Copilot-Session: 1fb0cde9-afea-4acd-924d-2d5ebcb29be4

* Use a controlled external origin in redirection tests (#68782) (#69417)

Co-authored-by: Ilona Tomkowicz <[email protected]>

---------

Co-authored-by: Daniel Roth <[email protected]>
Co-authored-by: Martin Costello <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ilona Tomkowicz <[email protected]>
Copilot-Session: 1fb0cde9-afea-4acd-924d-2d5ebcb29be4
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