The AutoReset E2E tests of BitFileInput and BitFileUpload open the second chooser before Firefox has closed the first

オープン
#15,625 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@msynk がすでに取り組んでいます。

2026年12月5日 から。

評価

この issue はまだ評価されていません。

説明

BitFileInputE2ETests.AutoReset_ClearsTheSelectionWhenTheChooserOpensAgain failed on both tries in "blazorui e2e / E2E firefox / wasm / 3 of 4" of All Other E2E CI run 47455950741. The second time the test opens the chooser, no file chooser arrives:

System.TimeoutException: Timeout 30000ms exceeded while waiting for event "FileChooser"
  at BitFileInputE2ETests.AutoReset_ClearsTheSelectionWhenTheChooserOpensAgain() in BitFileInputE2ETests.cs:520

Its twin BitFileUploadE2ETests.AutoReset_EmptiesTheListWhenTheChooserOpensAgain fails at the same step (BitFileUploadE2ETests.cs:579). The failures were all on Firefox in WebAssembly mode:

Run Test Tries
44288338655 (11-18) FileUpload both
44816299211 (11-20) FileInput first
46152706341 (11-28) FileInput both
46729186474 (12-01) FileUpload first
47455950741 (12-05) FileInput, FileUpload both, first
47467294543 (12-05) FileUpload first

Cause: Playwright's Firefox build reports the chooser too early.

Playwright 1.65.2 ships Firefox build r1572, which reports a chooser when Firefox announces that it is about to open the input's picker, and closes that picker from Firefox's parent process a moment later. Until the picker is closed, Firefox opens no other picker on the input (HTMLInputElement::InitFilePicker returns at once while one is running), so a second click on the same input that comes in that window opens nothing, and no chooser is reported.

Probe run 47474704882 clicked #fin-autoreset's Browse button twice in a row, recording whether the input matched :open when the first chooser was reported, and the page's events:

  • On Firefox (server mode), in 1 of 10 runs the input still matched :open when the first chooser was reported, and still matched it at the second click 70 ms later. The first picker had fired no cancel yet. The second click didn't use up the user activation, which InitFilePicker does only after that check, and no second chooser arrived in 10 seconds.
  • In the other 9 runs, Firefox closed the first picker within about 20 ms (cancel), the input no longer matched :open, and the second chooser arrived.
  • In the 10 runs on each engine and mode that waited for the input to leave :open before the second click, every second chooser arrived. On Chromium and WebKit the input never matched :open when the chooser was reported.

Playwright has fixed this in its Firefox build r1584 (microsoft/playwright#44390), which reports the chooser only once the picker it took over is done, to "let HTMLInputElement clear mPickerRunning before the client can open it again". No Playwright .NET package ships that build yet.

Fix. Each test that opens a chooser on an input it opens again waits, after it sets the chooser's files, until the input no longer matches :open (E2ETestBase.WaitForPickerClosedAsync). That covers both AutoReset tests through their PickThroughChooserAsync, BitFileInputE2ETests.Keyboard_EnterAndSpaceOnTheBrowseButtonOpenTheChooser and the two BitMarkdownEditorE2ETests image upload tests that open the upload button twice. On Chromium and WebKit, and on a Firefox build with r1584, the wait returns at once. The tests' checks don't change.

主要言語
C#
スター
1.4k
フォーク
264
平均マージ
5時間 25分
マージ済み PR(30日)
447

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bitfoundation/bitplatform のほかの issue

bitfoundation/bitplatform の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。