Repository navigation
Description
Description
BlazorWebTemplate_ConditionalPasskeyRegistration intermittently fails on Windows because the test reads a Playwright IResponse body after the page has navigated away from that response.
The generated application appears to complete the passkey flow correctly. The failure occurs later while the test inspects the captured HTML response.
Failure
Microsoft.Playwright.PlaywrightException: Protocol error (Network.getResponseBody): No resource with given identifier found
Response body is not available for a response that was navigated away from. Read response.body() before triggering any navigation.
at Microsoft.Playwright.Core.Response.BodyAsync()
at Microsoft.Playwright.Core.Response.TextAsync()
at BlazorTemplates.Tests.BlazorWebTemplateTest.BlazorWebTemplate_ConditionalPasskeyRegistration(...)
in /_/src/ProjectTemplates/test/Templates.Blazor.Tests/BlazorWebTemplateTest.cs:line 266
The failing line is:
var redisplayedPage = await upgradeResponse.TextAsync();Observed failures
| Build | PR | Theory case |
|---|---|---|
| 1610717 | #69441 | Failure / Success |
| 1610395 | #69461 | DatabaseFailure / Success |
| 1608370 | #67553 | Failure / Success |
| 1607585 | #69422 | Failure / Unsupported |
For builds 1610395 and 1608370, the published Templates.Blazor.Tests_net11.0_x64.xml contains 27 tests with 26 passing and this as the only failure.
Cause
The test captures the first /Account/PasskeyUpgrade response, but does not read its body immediately:
var upgradeResponseTask = page.WaitForResponseAsync(...);
await page.GetByRole(...).ClickAsync();
var upgradeResponse = await upgradeResponseTask;
await page.WaitForURLAsync(returnUrl, ...);The browser then performs another upgrade request and navigates back to returnUrl. The test performs additional page and server-state checks before finally calling upgradeResponse.TextAsync(). Chromium can discard the original response body once navigation occurs, producing Network.getResponseBody: No resource with given identifier found.
A representative successful server sequence before the exception is:
POST /Account/PasskeyUpgrade -> 200 text/html
POST /Account/PasskeyUpgrade -> 302
GET /auth?... -> 200 text/html
GET /test/passkeys -> 200 application/json
Network.getResponseBody fails while reading the earlier 200 response
This test and ordering were introduced in #68194. The affected builds belong to unrelated PRs, supporting that this is a shared test race rather than a product regression in those PRs.
Suggested fix
Read and retain the response text immediately after upgradeResponseTask completes and before waiting for or triggering subsequent navigation. Use the retained string for the later assertions.
Activity
github-actions commentedon Sep 24, 2026
Triage Summary
Area:
area-identity(already labeled; the failure is in the Blazor Web App template's passkey/Identity flow test)Type:
Task(bounded fix to a flaky test: read the response body before triggering navigation, rather than a product regression)Potential Duplicates
Retrigger CI (known flaky BlazorWebTemplate_ConditionalPasskeyRegistr…
Retrigger CI (known flaky BlazorWebTemplate_ConditionalPasskeyRegistr…
Retrigger CI (known flaky BlazorWebTemplate_ConditionalPasskeyRegistr…
Retrigger CI (flaky BlazorWebTemplate_ConditionalPasskeyRegistration, #…
Youssef1313 commentedon Nov 4, 2026
@wtgodbe Should this test be quarantined?
Pre-size the HttpLogging parameter lists (#70181)