Skip to content

Unquarantine WebWorker E2E tests and add diagnostics#66072

Merged
ilonatommy merged 4 commits intodotnet:mainfrom
ilonatommy:itomkowicz/unquarantine-webworker-tests
Apr 2, 2026
Merged

Unquarantine WebWorker E2E tests and add diagnostics#66072
ilonatommy merged 4 commits intodotnet:mainfrom
ilonatommy:itomkowicz/unquarantine-webworker-tests

Conversation

@ilonatommy
Copy link
Copy Markdown
Member

@ilonatommy ilonatommy commented Mar 30, 2026

Summary

Removes [QuarantinedTest] from 4 WebWorker template E2E tests quarantined in #66035. Adds build-time diagnostic logging to help diagnose CI-only failures if they recur.

What happened

CI server-side request logs (build 1353846) showed:

  • _framework/blazor.webassembly.js (unfingerprinted) → 404, only 2 fallback candidates, both rejected
  • _framework/dotnet.f86z0mrdmk.js (fingerprinted) → 200 OK, 4 candidates including direct routes

What we don't know

We could not reproduce the failure locally — the fingerprint placeholder #[.{fingerprint}] resolves correctly on current HEAD in both Debug and Release. The 51 commits between the breaking PR (#65885) and HEAD contain no relevant changes to static web assets, dev server, or templates. The root cause of the CI-only fingerprint resolution failure remains unknown.

Why diagnostics

Since the failure is not reproducible locally, we need CI-side evidence to diagnose it if it recurs. The LogBuildDiagnostics() method logs three things after each build/publish, written to test output (visible in CI artifacts):

  1. Processed HTML — the actual <script> tags from the build's processed index.html. Shows whether
    blazor.webassembly.js is fingerprinted or not.
  2. Endpoints manifest routes — the registered routes for blazor.webassembly from the
    .staticwebassets.endpoints.json. Shows whether the dev server would be able to serve the URL.
  3. Source HTML — the raw template index.html with the #[.{fingerprint}] placeholder, confirming the input is
    correct.

Together these pinpoint which stage failed: template source → MSBuild placeholder resolution → endpoint registration → served HTML.

The diagnostics are read-only (only File.ReadLines and JsonDocument.Parse on existing build output) and do not affect build behavior or test execution.

Fixes #66035

It had No-merge label because I wanted to run it several times before merging to collect logs but all runs were green. Removing the label.

Remove [QuarantinedTest] from 4 WebWorker template E2E tests that were
quarantined by dotnet#66035. The tests pass locally on current HEAD.

Add LogBuildDiagnostics() to capture:
- Processed HTML script tags (fingerprint resolution)
- Endpoints manifest routes for blazor.webassembly
- Source index.html placeholder state

This will help diagnose any CI-only failures where the fingerprint
placeholder resolves to empty, causing blazor.webassembly.js 404s.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 30, 2026 15:15
@github-actions github-actions bot added the area-blazor Includes: Blazor, Razor Components label Mar 30, 2026
@ilonatommy ilonatommy self-assigned this Mar 30, 2026
@ilonatommy ilonatommy added the * NO MERGE * Do not merge this PR as long as this label is present. label Mar 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 re-enables previously quarantined Blazor WebWorker template E2E tests and adds extra build-time logging intended to diagnose CI-only failures related to static asset fingerprinting and static web assets endpoint routing.

Changes:

  • Removed [QuarantinedTest] from 4 WebWorker template E2E tests.
  • Added LogBuildDiagnostics(...) and invoked it after build/publish to print processed HTML references and static web assets endpoints manifest routes.

ilonatommy and others added 3 commits March 30, 2026 17:33
- Use TemplateBuildDir/TemplatePublishDir instead of hardcoded path
- Guard against missing obj directory
- Only log HTML files that have matching blazor.webassembly lines
- Use File.ReadLines instead of File.ReadAllText
- Log full exception (ex.ToString()) instead of just ex.Message

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ilonatommy ilonatommy removed the * NO MERGE * Do not merge this PR as long as this label is present. label Apr 1, 2026
@ilonatommy ilonatommy enabled auto-merge (squash) April 1, 2026 10:40
Comment on lines +240 to +243
// Log the processed index.html to check if fingerprints resolved correctly.
// The #[.{fingerprint}] placeholder should be replaced with an actual hash.
// If it resolves to empty, the script tag will reference the unfingerprinted
// 'blazor.webassembly.js' which returns 404 from the dev server.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we checking/asserting that this happened correctly somewhere? E.g., that the fingerprint is not empty and is not "#[.{fingerprint}]" still?

@ilonatommy ilonatommy merged commit c6843cc into dotnet:main Apr 2, 2026
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 11.0-preview3 milestone Apr 2, 2026
@wtgodbe wtgodbe modified the milestones: 11.0-preview3, 11.0-preview4 Apr 4, 2026
github-actions bot added a commit that referenced this pull request Apr 4, 2026
…rs, CanDisposeWorker)

These tests were recently unquarantined in #66072 (issue #66035) but
have already failed again (build 1342501). Re-quarantining to avoid
CI disruption while the underlying flakiness is investigated.

Associated issue: #aw_webwrk1

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
wtgodbe added a commit that referenced this pull request Apr 6, 2026
The Case B re-quarantine logic was counting failures from before the
unquarantine commit was merged. This led to tests being unnecessarily
re-quarantined based on stale failure data (e.g., PR #66148 re-quarantined
tests based on a failure from March 18, but the unquarantine PR #66072
wasn't merged until March 30).

Updated to explicitly require that only failures occurring after the
unquarantine merge date are considered.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
wtgodbe added a commit that referenced this pull request Apr 6, 2026
The Case B re-quarantine logic was counting failures from before the
unquarantine commit was merged. This led to tests being unnecessarily
re-quarantined based on stale failure data (e.g., PR #66148 re-quarantined
tests based on a failure from March 18, but the unquarantine PR #66072
wasn't merged until March 30).

Updated to explicitly require that only failures occurring after the
unquarantine merge date are considered.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
wtgodbe added a commit that referenced this pull request Apr 6, 2026
The Case B re-quarantine logic was counting failures from before the
unquarantine commit was merged. This led to tests being unnecessarily
re-quarantined based on stale failure data (e.g., PR #66148 re-quarantined
tests based on a failure from March 18, but the unquarantine PR #66072
wasn't merged until March 30).

Updated to explicitly require that only failures occurring after the
unquarantine merge date are considered.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
wtgodbe added a commit that referenced this pull request Apr 6, 2026
…66174)

* Fix re-quarantine criteria to only count post-unquarantine failures

The Case B re-quarantine logic was counting failures from before the
unquarantine commit was merged. This led to tests being unnecessarily
re-quarantined based on stale failure data (e.g., PR #66148 re-quarantined
tests based on a failure from March 18, but the unquarantine PR #66072
wasn't merged until March 30).

Updated to explicitly require that only failures occurring after the
unquarantine merge date are considered.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update .github/workflows/test-quarantine.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Apr 13, 2026
…rantine ShutdownTests.OutOfProcessToInProcessHostingModelSwitchWorks

- Re-quarantine WebWorkerTemplateE2ETest at class level (was unquarantined in #66072, failing again in build 1373142)
- Quarantine BlazorWasmTemplateTest at class level (NU1603 NuGet restore failures in builds 1342501 and 1373142)
- Unquarantine ShutdownTests.OutOfProcessToInProcessHostingModelSwitchWorks (100% pass rate in quarantine pipeline for 30+ days)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
wtgodbe added a commit that referenced this pull request Apr 13, 2026
… WebWorkerTemplateE2ETest; unquarantine ShutdownTests (#66294)

* Quarantine BlazorWasmTemplateTest and WebWorkerTemplateE2ETest; unquarantine ShutdownTests.OutOfProcessToInProcessHostingModelSwitchWorks

- Re-quarantine WebWorkerTemplateE2ETest at class level (was unquarantined in #66072, failing again in build 1373142)
- Quarantine BlazorWasmTemplateTest at class level (NU1603 NuGet restore failures in builds 1342501 and 1373142)
- Unquarantine ShutdownTests.OutOfProcessToInProcessHostingModelSwitchWorks (100% pass rate in quarantine pipeline for 30+ days)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update WebWorkerTemplateE2ETest.cs

* Update BlazorWasmTemplateTest.cs

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: William Godbe <wigodbe@microsoft.com>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quarantine WebWorkerTemplateE2ETest (CanDisposeWorker, HandlesErrors, CanInvokeMethods, CanInvokeMethodsAfterPublish)

4 participants