Skip to content

Wait for .NET to hear each opening of the typed confirmation - #189

Merged
pournasserian merged 2 commits into
mainfrom
187-typed-confirmation-flake
Dec 1, 2026
Merged

pournasserian merged 2 commits into
mainfrom
187-typed-confirmation-flake

Conversation

@pournasserian

Copy link
Copy Markdown
Member

DialogTests.ATypedConfirmationOpensOnItsFieldAndAnIncorrectNameCannotConfirm left the typed confirmation open after its confirm, now and then, in server and WebAssembly.

Cause

Reproduced in a Linux container with the CPU held to 1.5 cores and the dialog tests running side by side (1 failure in 6 runs, then 1 in 10), and traced on the page:

757 key Enter        763 open            (the second opening)
774–814 the name typed
860 key Enter        861 submit
868 toggle open      868 report {"sequence":2,"open":true}
970 data-fl-overlay-open=1:2

The browser reports an opening with the toggle event, a task after it. The keys the test sent at once held that task back until after the confirm, so .NET heard the confirm (which closes the dialog) first and the opening after it, and its model ended open. Record 0006 accepts this order: "A host that closes an overlay in the same moment as the page opens it may hear the opening after its own render; the model then says what holds." No person types a name and confirms inside that gap.

Change

The test waits for .NET to hear each opening (HeardAsync, 1:1 and then 1:2) before it types, as #175 did for the sibling test. No timeout raised, no retry, no assertion changed. The component is not changed.

Checks

  • Server mode, the test alone, 30 runs in a row: 30 passed (Windows, Chromium). It had passed 30 of 30 there before the change too, so this machine alone does not show the fault.
  • Linux container, 1.5 cores, DialogTests in server and WebAssembly, 20 runs: 0 failures (before the change: 1 in 6, 1 in 10).
  • WebAssembly, the test alone, 10 runs: 10 passed. DialogTests in the three modes: 24 passed, 1 skipped.
  • dotnet build -c Release -warnaserror: 0 warnings, 0 errors.
  • Component tests and Markdown: not touched; run by CI.

Closes #187

@pournasserian

Copy link
Copy Markdown
Member Author

Review by a fresh agent on the diff and #187: no problem of substance. It confirmed the values 1:1 and 1:2 in both interactive modes (the close made by the model is not reported back), that the wait cannot pass before .NET heard the opening or hang, and that no other test of the file types right after an opening without a guard (the explicit published-site test is the only one with just SettledAsync; it does not run in CI). It also traced the exact path: the submit reaches .NET while its model is already closed, so it changes nothing, and the late report then opens the model. Its two nits on the comment are done: the reason now sits on the second wait, which is the one that cures the race, and says that the late opening is what leaves the dialog open.

@pournasserian

Copy link
Copy Markdown
Member Author

The second commit moves the comment only. Re-checked on it after a clean build: DialogTests in the three modes 24 passed, 1 skipped; the test alone in server mode 30 of 30.

@pournasserian
pournasserian merged commit 08dae2a into main Dec 1, 2026
8 checks passed
@pournasserian
pournasserian deleted the 187-typed-confirmation-flake branch December 1, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The typed confirmation dialog can stay open after its confirm in an interactive mode

1 participant