ci: stop apt from gating the showcase Chromium install - #1034
Merged
Conversation
`npx playwright install --with-deps chromium` shells out to apt-get, and the Azure Ubuntu mirror on GitHub's runners intermittently stops responding there. It stalled this job for 21 minutes on PR #1032, and on PR #1031 it hit the 10-minute step bound from #1033 with apt still retrying InRelease fetches against azure.archive.ubuntu.com. Every other step in the job passed both times, and the same job succeeded in ~2 minutes on other runs, so the browser download itself was never the problem. Drop --with-deps. The ubuntu-24.04 runner image already ships Chromium's shared libraries, and Playwright here is pinned to 1.57, well past the 1.45 release where Ubuntu 24.04 support landed. If a future image drops a library, the launch fails fast with a missing-library error naming it, which is a better signal than an apt hang and is fixable by adding that one package instead of putting all of apt back on the critical path. Also cache ~/.cache/ms-playwright keyed on the lockfile. The browser only changes when the pinned Playwright version does, so most runs now skip the download entirely rather than re-fetching it.
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.
Root cause
Showcase Tool Testshas been intermittently hanging. The logs from PR #1031 pin it down precisely — it is not the browser download, it isapt.npx playwright install --with-deps chromiumshells out toapt-get, which then stops responding against the Azure Ubuntu mirror:Nothing was logged for the 9.5 minutes between the last
InReleaseline and the timeout.Evidence it is the mirror and not the diff or the download:
The step bound added in #1033 is doing its job here: it converted a six-hour hang into a labelled 10-minute failure that names the culprit. This PR removes the cause.
Fix
Drop
--with-deps. That flag exists toapt-get installChromium's shared libraries. Theubuntu-24.04runner image already ships them, and Playwright is pinned to 1.57.0 here — well past 1.45, where Ubuntu 24.04 support landed. This takes apt off the critical path entirely.Cache
~/.cache/ms-playwrightkeyed on the lockfile. The browser only changes when the pinned Playwright version does, so most runs skip the download entirely.Risk, and why it is the right trade
If a future runner image drops a library, Chromium fails to launch. That surfaces as a missing-library error naming the library, in seconds — and the fix is to
apt-get installthat one package, not to put all of apt back in front of every run. That is a strictly better failure mode than an unexplained hang. The reasoning is recorded in a comment on the step so it does not get "helpfully" reverted later.Worth noting the job genuinely needs a browser:
test/visual-report.test.mjscallschromium.launch()to verify the generated report opens without console errors. So dropping the install altogether was not an option — only the apt half is unnecessary.Verification
Deliberately proven in CI rather than argued: this PR's first run has a cache miss, so it exercises the real
npx playwright install chromiumpath without--with-deps. If the job goes green, the removal is confirmed on the actual runner image.