Skip to content

Fix navigation race in Blazor recovery email template test - #70806

Open
karmegams02 wants to merge 5 commits into
dotnet:mainfrom
karmegams02:70568_test_failure
Open

karmegams02 wants to merge 5 commits into
dotnet:mainfrom
karmegams02:70568_test_failure

Conversation

@karmegams02

@karmegams02 karmegams02 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes a Playwright navigation race in
BlazorWebTemplate_RecoveryEmailsUseStoredAddressAndDoNotSendWithoutIt
when checking captured emails after a missing-address form submission.

Root cause

The recovery form helper submitted a synthetic form through JavaScript and
waited for the POST response, but not for the resulting document to finish
loading.

The missing-address cases then immediately read captured emails through
EvaluateAsync. Navigation could replace the document during that call,
causing Execution context was destroyed, most likely because of a navigation.

Fix

  • Locate the rendered recovery form using its hidden _handler input.
  • Fill the email field and click the submit button through Playwright, which
    waits for navigation to commit.
  • Wait for LoadState.Load before returning the captured POST response.

Only the private test helper changes. Existing assertions remain unchanged.
No shipping code or public API changes.

Test

Reproduced the original failure after application startup. The existing
Chromium test passed 10 consecutive runs with the fix, checking that both
recovery actions use the stored address and send no email when it is missing.

Fixes #70568

@github-actions github-actions Bot added the area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI label Nov 24, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 24, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @karmegams02. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@karmegams02
karmegams02 marked this pull request as ready for review November 24, 2026 07:19
@PureWeen

Copy link
Copy Markdown
Member

/review

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.

@dotnet-policy-service dotnet-policy-service Bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Dec 1, 2026

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — b12c4209 Deployed Nov 24, 2026 by dotnet-policy-service[bot] via pat_pool #2749
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI community-contribution Indicates that the PR has been added by a community member pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quarantine BlazorTemplates.Tests.BlazorWebTemplateTest.BlazorWebTemplate_RecoveryEmailsUseStoredAddressAndDoNotSendWithoutIt

3 participants