[Bug]: Browser plugin — on Windows the run can hang forever before any browser starts (waitUntil() misses Playwright's "Listening on" line)
I maintainer di solito rispondono entro 5 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 74/100
Direzione di ricerca
Start at PlaywrightNpmServer::start() and inspect the Symfony Process waitUntil(), isRunning(), getOutput(), and getIncrementalOutput() behavior described in the report. Reproduce with tests/Browser/OneTest.php on Windows using the 20-run loop, then verify that the server-start wait cannot miss the “Listening on” line, enforces the 30-second limit, and turns a timeout into the reported error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What Happened
On Windows, a browser test run sometimes hangs forever before any browser starts — no output at all, not even the first test name. About 1 run in 4 on our machine. Filed here because issues are disabled on pestphp/pest-plugin-browser.
It is not #1855 or #1801: in those the websocket is connected. Here the plugin never gets that far; it is still inside PlaywrightNpmServer::start().
Cause. start() waits for the server's one Listening on line with setTimeout(0) and
$this->systemProcess->waitUntil(
fn (string $type, string $output): bool => str_contains($output, $this->until)
);
On Windows, Symfony Process' waitUntil() calls isRunning() on every loop (Process.php, the '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : … line; also the updateStatus(false) right at the start). isRunning() → updateStatus() → readPipes() reads new output into the buffer without calling the waitUntil callback. If the Listening on line arrives at that moment, the callback never sees it; Playwright prints nothing else, so the loop waits forever.
Evidence, captured during a hang:
netstat:127.0.0.1:<port> LISTENINGby theplaywright … run-servernode process.%TEMP%\sf_proc_01.outholds 35 bytes =Listening on ws://127.0.0.1:51105/\n.- A trace in the plugin logged
start()being entered, then nothing: thewaitUntilcallback was never called with any chunk (in good runs it is called once, ~0.4 s later, with the whole line). - Starting the same command 15 times from a plain script that polls
getIncrementalOutput()never missed the line, which points atwaitUntil()+isRunning()rather than Playwright.
How to Reproduce
On Windows 11, run a one-test browser file (visit('/')->assertSee('…')) in a loop, e.g. 20 × php artisan test tests/Browser/OneTest.php with a 45 s limit. A run hangs every 3–5 runs.
Suggested fix
Poll the whole buffered output (which isRunning() and getOutput() both fill) with a time limit, instead of relying on the callback:
$deadline = microtime(true) + 30;
while ($this->systemProcess->isRunning() && ! str_contains($this->systemProcess->getOutput(), $this->until)) {
if (microtime(true) > $deadline) {
$this->systemProcess->stop(0.1);
throw new RuntimeException('Playwright did not start within 30 seconds.');
}
usleep(10_000);
}
With this change, 30 of 30 runs passed (before: a hang every 3–5 runs). A time limit here would also have turned the hang into a clear error.
Versions
- Pest 5.2.1, pest-plugin-browser 5.0.1, symfony/process 8.1.7
- Playwright 1.63.0 (Chromium)
- PHP 8.4.24
- Windows 11 Pro (10.0.26200), run from Git Bash
- Lingua principale
- PHP
- Stelle
- 11.8k
- Fork
- 559
- Merge medio
- 5g 23h
- PR unite (30g)
- 24
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pestphp/pest
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 5 giorni
-
[Bug]: --mutate hides unreadable files, so mutants behind a failed read can never be killedForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 5 giorni
-
[Bug]: [mutate] Windows: @pest-mutate-ignore comments land on line 1 in files with LF line endingsForse già presa @webdevsamran l’ha presa 57 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 5 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 5 giorni
-
[pest-plugin-browser] Page::waitForLoadState() never sends its message — waitForEvent() is a silent no-opForse già presa @asllanmaciel l’ha presa 70 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
pestphp/pest#1892 · 2 commenti ·
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di pestphp/pest
Issue simili
-
Group 2 - Data Storage | Tripal DBX | Chado Group 5 - Search | ElasticSearch | Views Priority - Medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
nginx update required due to NGINX2RootForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
mailcow/mailcow-dockerized#7668 · 5 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
lara-zeus/spatie-translatable#80 ·
I maintainer di solito rispondono entro 1 giorno
-
small
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
uiowa/uiowa#10296 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
asyncapi/modelina#2709 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno