fix: prevent playwright CI from hanging on apt interactive prompts#1508
Open
SukuWc wants to merge 7 commits into
Open
fix: prevent playwright CI from hanging on apt interactive prompts#1508SukuWc wants to merge 7 commits into
SukuWc wants to merge 7 commits into
Conversation
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>
|
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 |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
playwright install --with-deps chromiumruns a secondaryapt-get installafter downloading the browser binaryDEBIAN_FRONTEND=noninteractive, apt can block on interactive prompts (debconf/needrestart), hanging the job until the 30-minute timeout firesDEBIAN_FRONTEND: noninteractiveenv var to that stepTest plan
🤖 Generated with Claude Code