Repository navigation
Stabilize Blazor Web JS initializer tests - #70258
Conversation
Co-authored-by: Copilot <[email protected]>
|
/azp run aspnetcore-components-e2e The Mono server leg failed only in 🤖 Posted by Flaky (AI Agent) |
|
No pipelines are associated with this pull request. |
There was a problem hiding this comment.
🔵 Needs a closer look
The environment-sensitive initializer failures still need Linux and Windows Helix confirmation, as reported validation covers only local Linux/Chrome and reviewers could not execute the browser matrices.
No open issues 🎉
What changed in this PR
Stabilizes Blazor Web JavaScript initializer tests by making startup settings available before navigation-driven initialization, while preserving coverage for startup without explicit WebAssembly options.
Changes:
- Passes initializer settings through query parameters instead of race-prone session storage writes.
- Adds fallback WebAssembly resource mapping and asserts that startup loads
WasmMinimal/_framework/dotnet.js. - Removes quarantine attributes from the modern and classic initializer tests.
| File | Description |
|---|---|
| src/Components/test/testassets/Components.TestServer/wwwroot/Components.TestServer.lib.module.js | Supplies fallback resource mapping in beforeWebStart. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/App.razor | Reads initializer startup settings from query parameters. |
| src/Components/test/E2ETest/ServerRenderingTests/BlazorWebJsInitializersTest.cs | Updates test URLs, checks the WebAssembly asset path, and removes quarantine attributes. |
Review effort: Balanced
|
/review |
|
Copilot's local review panel found no issues to raise at this commit. |
Co-authored-by: Copilot <[email protected]>
|
✅ No documentation PR was created. Confidence that documentation is needed: 2% No docs needed: the PR only stabilizes Blazor Web JS initializer E2E tests (test infrastructure). Documentation surfaces considered
|
Backport of #70258. Preserve the release branch quarantine state. (cherry picked from commit 0d7e878) Co-authored-by: Brennan <[email protected]> Co-authored-by: Copilot <[email protected]>
Stabilize Blazor Web JS initializer tests
Make the Blazor Web initializer setup deterministic and validate the WASM asset path.
Description
BlazorWebJsInitializersTestuses the streaming browser context, whose Selenium page-load strategy does not wait for navigation to complete. The test previously wroteblock-webassembly-settingsto session storage after navigating to/initializers, racing the page'sBlazor.start()call:dotnet.jswas requested from/subdir/_framework/dotnet.jsinstead of the test client's/subdir/WasmMinimal/_framework/dotnet.js. Historical failures show that wrong-path request intermittently returning200 text/plainwith no module MIME type, aborting startup before callbacks were recorded.The fix passes one-shot initializer settings in the target URL, so they are available before startup without cross-row storage state. The server-project
beforeWebStartinitializer supplies the/WasmMinimalresource mapping when the caller intentionally omits WebAssembly options. This preserves the original coverage for #54049: the framework-createdoptions.webAssemblyobject is used by initializers before WebAssembly startup.The modern test now also asserts that the browser loaded
/WasmMinimal/_framework/dotnet.js, making the failure path deterministic instead of relying on the wrong route to intermittently return an invalid MIME type. The classic test shares the same setup and is unquarantined as part of the same fix. Related existing proposal: #69193.Evidence
Without the
beforeWebStartmapping, the unchanged regression assertion failed all four WebAssembly rows and the captured network log showed200 text/javascript - /subdir/_framework/dotnet.js; all four non-WebAssembly controls passed. With the fix:Remaining uncertainty: validation used local Linux with Chrome 156. The historical MIME failure is environment-sensitive, so the draft should remain open until the repository's Linux/Windows Helix coverage confirms the route assertion and initializer behavior.
Issue: #68856
🤖 Posted by Flaky (AI Agent)