Skip to content

fix: prevent playwright CI from hanging on apt interactive prompts#1508

Open
SukuWc wants to merge 7 commits into
stablefrom
fix/playwright-install-noninteractive
Open

fix: prevent playwright CI from hanging on apt interactive prompts#1508
SukuWc wants to merge 7 commits into
stablefrom
fix/playwright-install-noninteractive

Conversation

@SukuWc
Copy link
Copy Markdown
Member

@SukuWc SukuWc commented Jun 2, 2026

Summary

  • playwright install --with-deps chromium runs a secondary apt-get install after downloading the browser binary
  • Without DEBIAN_FRONTEND=noninteractive, apt can block on interactive prompts (debconf/needrestart), hanging the job until the 30-minute timeout fires
  • Fix: add DEBIAN_FRONTEND: noninteractive env var to that step

Test plan

  • Playwright CI workflow completes without hanging on the install step

🤖 Generated with Claude Code

Set DEBIAN_FRONTEND=noninteractive so the secondary apt-get call inside
`playwright install --with-deps` never blocks on debconf/needrestart prompts,
which was causing the job to hang for 30 minutes until timeout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Visit the preview URL for this PR (updated for commit cab07b1):

https://grid-editor-web--pr1508-fix-playwright-insta-gzwelgwa.web.app

(expires Thu, 02 Jul 2026 15:18:17 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2b65ba6ef19c55d367eaffd04e46bcde25305d6f

SukuWc and others added 6 commits June 2, 2026 13:01
playwright uses `sudo -- sh -c "apt-get ..."` with no -E flag, so env vars
set in the workflow step are stripped by sudo's env_reset. Writing to
/etc/environment is read by PAM and survives the sudo env reset, ensuring
apt never blocks on interactive prompts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…do call

playwright internally runs `sudo -- sh -c "apt-get ..."` with no -E flag.
sudo's env_reset strips DEBIAN_FRONTEND and NEEDRESTART_MODE before the
shell starts, so setting them in the workflow env has no effect. Adding
them to sudoers env_keep preserves them through the reset, unblocking
both debconf and needrestart interactive prompts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… hang

needrestart runs as a dpkg trigger after apt-get installs packages and
can block waiting for interactive input when services need restarting.
Removing it from the throwaway CI runner is the most reliable fix since
env var approaches (DEBIAN_FRONTEND, sudoers env_keep) don't survive
playwright's internal `sudo -- sh -c` invocation cleanly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
--with-deps installs hundreds of packages including fonts-unifont which
triggers a slow fc-cache rebuild, and uses azure.archive.ubuntu.com mirrors
that are intermittently unreachable on GitHub runners, causing the step to
hang past the 30-minute job timeout.

Install the browser binary first, then only the ~7 system libs Chromium
actually needs. This cuts install time from 20+ min to under 10 min.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
apt-get update on ubuntu-latest runners tries azure.archive.ubuntu.com
which is intermittently unreachable, causing hangs. The runner image
package lists are already up to date so we can install directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hang

playwright install chromium runs a post-download validation that calls
its own internal `sudo apt-get update && apt-get install` for any missing
.so libs. On ubuntu-latest, apt-get update hangs on azure mirrors.

By installing the 7 required libs first (using the runner's existing
package cache, no update needed), playwright's validation finds them all
present and skips the internal apt-get entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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