Repository navigation
ci: install the harness's browser without apt-getting fonts - #13
Merged
Merged
Conversation
The Browser harness job ran `playwright install --with-deps`, and on 2026-10-23 it hit its ten-minute timeout three times in an hour, always inside that step. Playwright's dependency install always adds its "tools" group, xvfb and its font packages, on top of the browser's own libraries. On the ubuntu-24.04 image every one of those libraries is already installed: the passing run reports "already the newest version" for each. So what --with-deps actually did was apt-get about 26 MB, the fonts plus patch upgrades of libglib2.0, libnss3 and xvfb, from azure.archive.ubuntu.com. That mirror answered the index fetch in a second and then served the packages at about 40 KB/s; fonts-wqy-zenhei alone, 7.5 MB, took three minutes. The browser is now installed without system packages, and a new step finds out whether the runner can run it by running it: a launch fails if the binary cannot load a library it links against, and opening a page starts a renderer. Playwright's own host-dependency check does not help here; in 1.62.1 it runs ldd over chrome-linux/, and the x64 headless shell unpacks to chrome-headless-shell-linux64/, so it checks nothing. If the probe passes, nothing touches apt. If it fails, as it might on a later image while ubuntu-latest moves to a new Ubuntu release, the job falls back to `playwright install-deps` and says so in a warning, because that path brings the fonts and the slow-mirror exposure back. Playwright 1.62.1 has a dependency table for Ubuntu 26.04, so the fallback works there too. None of this touches what is tested. The harness forbids fonts in its own policy (font-src 'none') and takes no screenshots, and the test step, its MTG_REQUIRE_BROWSER_HARNESS and its command are unchanged: a browser that cannot start still fails the job. The browser download itself is not cached. The 114.7 MiB headless shell came from cdn.playwright.dev in about 3.5 s; restoring a cache of the same size would not be faster.
Arman2122
force-pushed
the
claude/adoring-cartwright-e6bd40
branch
from
October 23, 2026 12:42
512fdb3 to
be224d1
Compare
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.
Only the Browser harness job changes. The test it exists for runs exactly as before: same command, same
MTG_REQUIRE_BROWSER_HARNESS=1.Why
On 2026-10-23 the job hit its 10-minute timeout three times in an hour, every time inside
npx playwright install --with-deps chromium-headless-shell. Examples are run 39949830616 attempt 1, 39947798647 attempt 1 and 39950087921 attempt 1. Two more runs passed but took 6 minutes in that step.--with-depsalways adds Playwright's "tools" group: xvfb and the fonts. Its CLI has no switch to leave it out (registry.installDepsdoestargets.add("tools")in 1.62.1). In the attempt that passed, apt said "already the newest version" for every library in the chromium group. So the 25.9 MB it fetched was:In the timed-out attempt the index fetch took 1 s, then packages came from azure.archive.ubuntu.com at about 40 KB/s. fonts-wqy-zenhei (7.5 MB) alone took 3 min 8 s.
The harness sets
font-src 'none'and takes no screenshots, so the fonts were never part of what it tests.What
npx playwright install chromium-headless-shell, without--with-deps.test/webbridgethe way the harness does:chromium.launch(),newPage(),setContent(),close(). The launch fails if the binary cannot load a library it links against, and the page starts a renderer.::warning::and runsnpx playwright install-deps chromium-headless-shell. That is a correctness net for a future image, not a speed path, because it brings the fonts back. The warning says so.chrome-linux/, but the x64 headless shell unpacks tochrome-headless-shell-linux64/, so it checks nothing. That is why the probe launches the browser for real.Measured
All durations are per-step times from the Actions API, in whole seconds.
Before. All 19 Browser harness jobs on 2026-10-23 with the old
--with-depsstep:After. Every job below ran without touching apt: the probe passed, and there was no fallback and no warning. All 24 harness checks passed every time.
1ae11d4 is the first push of this PR. It runs the same commands; only the comment wording and the probe's success message differ.
Install Chromium went from 16–28 s (median 18 s) to 4–6 s (median 5 s over the five attempts on be224d1), plus a 0–2 s probe. The whole job went from 50–62 s to 37–51 s. Most of what is left is
go testbuilding the package.The fallback, and the slow mirror again. The two experiments ran on a temporary commit, 512fdb3, which has since been force-pushed away and is not part of this PR. It added a copy of the job on
ubuntu-26.04(the row above) and forced the probe to fail on 24.04, to exercise the fallback.In run 39954879316 attempt 1, the forced fallback emitted its warning and ran
install-deps. That apt install then hit the 10-minute timeout, because the mirror was slow again from 12:41 to 12:51: fonts-wqy-zenhei (7,472 kB) took 182 s, about 41 KB/s. In that same window, 39955344880 #1 and #2 and 39954786314 #2 installed in 5–6 s, because they never touch apt.I reran the forced-fallback job once (39954879316 attempt 2, 12:56–13:06), and it timed out the same way: fonts-wqy-zenhei took 183 s. So the mirror was slow from at least 12:41 to 13:06. The no-apt attempts above ran between 12:45 and 12:54 and were not affected. I did not rerun it again.
What this shows about the fallback:
install-depsstarts and runs.install-depsthe job runs the same commands as the old--with-depsstep, which passed 16 times today.Not done
ubuntu-latestlike the others.