Skip to content

setup: cap the Playwright browser install with a wall-clock timeout - #2359

Open
Googox wants to merge 3 commits into
garrytan:mainfrom
Googox:fix/playwright-install-timeout
Open

setup: cap the Playwright browser install with a wall-clock timeout#2359
Googox wants to merge 3 commits into
garrytan:mainfrom
Googox:fix/playwright-install-timeout

Conversation

@Googox

@Googox Googox commented Jul 26, 2026

Copy link
Copy Markdown

No description provided.

Googox and others added 3 commits July 26, 2026 23:38
`bunx playwright install chromium` can download a browser archive to 100%
and then hang indefinitely in its extraction step. It emits no error and
silently re-downloads the whole archive when it retries, so `setup` blocks
forever with no output — indistinguishable from a slow connection.

Observed on Windows 11 / Git Bash: three full 181 MB re-downloads over ~50
minutes, extraction stuck after writing 3 files. Not disk space (334 GB
free), not disk speed (NVMe, 2.8 GB/s measured), not permissions. Manual
`unzip` of the identical archive finished in 3.5 seconds, so the defect is
in Playwright's own extraction path.

_run_with_timeout is a portable stand-in for GNU coreutils `timeout`, which
macOS does not ship. Default ceiling is 1800s, generous for a ~280 MB
download on a slow line but finite; override with
GSTACK_PLAYWRIGHT_INSTALL_TIMEOUT. On timeout the install aborts with
pointers to the manual recovery steps rather than suggesting a longer wait,
since extraction never completes no matter how long you give it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Static tripwire plus a behavior matrix for _run_with_timeout.

The load-bearing invariant is that every `playwright install` invocation in
setup runs under the guard. An unguarded call re-introduces a silent
infinite hang that looks like a slow download, which is exactly the failure
mode that is hard to diagnose from the outside — so fail CI instead.

The matrix also pins that a killed command reports 124 without leaving the
helper blocked in `wait`, and that a command's own non-zero status is
passed through rather than masked as a timeout.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Documents the symptom (download hits 100%, extraction hangs, installer
silently re-downloads) and the manual unzip recovery, which takes seconds
where the installer never finishes.

Instructs readers to copy the version and platform segment out of their own
installer output rather than trusting a hardcoded URL: only the win64 path
is verified. Also calls out that /browse needs the headless-shell build,
not just chromium — extracting only chromium-<REV> still fails with
"Executable doesn't exist at ...chrome-headless-shell.exe".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@trunk-io

trunk-io Bot commented Jul 26, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@Googox Googox changed the title Fix/playwright install timeout setup: cap the Playwright browser install with a wall-clock timeout Jul 26, 2026
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.

1 participant