Conversation
The component suite is the slowest check on a pull request. On the last run of main each of the two shards spent about 3m30 and 3m56 in `Run Playwright tests`, against 45 seconds of browser install and 15 of npm ci, so the test time is what dominates and it halves again with twice the shards. The merge-reports job already collects `blob-report-*` from whatever shards ran, so it needs no change. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8970 +/- ##
=======================================
Coverage 58.32% 58.33%
=======================================
Files 123 123
Lines 4451 4452 +1
Branches 1332 1332
=======================================
+ Hits 2596 2597 +1
Misses 1576 1576
Partials 279 279 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The install step was 46s of the 5 minute workflow, per shard, and two thirds of it was apt rather than the browser downloads. The image ships both, so the step goes away entirely and the pull shows up as container setup instead: 1m09 against 1m49 for the same work on a bare runner. The tag is tied to the `playwright-core` version in the lockfile, not to `@playwright/test`, which is a version ahead of it. A mismatch is not fatal, Playwright downloads what it is missing, but it gives back the seconds this buys. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
The steps run as root while the runner mounts /github/home owned by the image's pwuser, and Firefox refuses to launch when $HOME belongs to somebody else: Running Nightly as root in a regular user's session is not supported. ($HOME is /github/home which is owned by pwuser.) Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Round one settled how to get the browsers onto the runner. This round asks what the config's `workers: process.env.CI ? 1 : undefined` costs: the whole suite at one, two and four workers, so nothing but the worker count differs, with the flaky count recorded next to the duration because the visual assertions are the reason it was pinned. Alongside it, the two shapes worth comparing end to end: four shards at one worker, which is what #8970 lands, and two shards at two workers, which pays the container and npm setup half as often. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
The config serialised the suite on CI, on a runner with four cores. Measured over the whole suite in one job, one worker takes 6m19, two take 4m49 and four take 4m22, so the second core is worth having and the third and fourth are not. Flakiness follows the same curve rather than the shard count: one flaky test at one worker, one at two, two at four, and none at all across eight single-worker shards. Two workers is what the suite already produces on its own. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
There was a problem hiding this comment.
Instead we can also just utilize the browser installed in github default runner image just like server does.
Also this should not be changed here but in the template repository.
There was a problem hiding this comment.
Also this should not be changed here but in the template repository.
Yeah, I plan to upstream it if we approve. But it's best to have real live data 👍
There was a problem hiding this comment.
Instead we can also just utilize the browser installed in github default runner image just like server does.
But here we test all three browsers, I'm not against narrowing it down, but that seemed on purpose. Onn server we're only testing against "chrome"
The component suite is the slowest check on a pull request, at six minutes. Three changes, each one measured before it was kept:
Six minutes to three and a half, over three runs of the final shape (35199323059): 3m33, 3m27, 3m31, first job start to merged report, against 6m00 on
main. The per-shard test step went from 3m28–3m56 to 1m08–1m59.Warning
Firefox will not start in this image with the runner's default
$HOME: the steps run as root while/github/homebelongs to the image'spwuser. The workflow setsHOME: /rooton the job, which is what the Playwright documentation prescribes. Without it every Firefox test fails to launch.Important
The image tag is tied to the
playwright-coreversion in the lockfile, 1.62.1, not to@playwright/test, which is already on 1.63.0. A mismatch is not fatal, Playwright downloads whatever the image lacks, but it silently gives back the seconds this buys, so the tag has to move when that version does.Why four shards, and why that was not enough on its own
Four shards (35193512023) against the last run of
mainbefore this branch (35192646502):Run Playwright testsper shardInstall Playwright browsersper shardThe test time halved, the workflow gained 50 seconds of it. Every shard repeats about 75 seconds of
npm ciplus browser install, and the total test time across shards went up, 7m24 to 8m39, because each shard pays its own startup. So the next win had to come from the setup, and more shards alone would have made it worse.Why the image, and why a cache does not work
Of the 46s install step, about 30s was the apt work behind
--with-depsand 15s the browser downloads. Four ways of doing it ran side by side onci/measure-playwright-install, each ending with the same spec on all three engines, so a variant that skips a step still has to prove the browsers launch. Job start to finish, cold cache then warm:install --with-deps, what main does~/.cache/ms-playwright+--with-depsmcr.microsoft.com/playwrightimageThe cache is worthless on its own: warm, B restored a gigabyte in 8 seconds and then still spent 62s in
install --with-deps, because the apt work runs whether or not the browsers are on disk. It came out slower than the baseline it was meant to beat.C shows where those 30 seconds go. With the browsers cached the install drops to one second, chromium and firefox launch fine on a bare runner, and webkit dies on
libgtk-4.so.1, the gstreamer set,libopus,libgrapheneandlibevent. The apt half exists for webkit alone, and there is no split to be had: those are its dependencies.So D. No install step, the pull becomes 26–40s of container setup, and it does not occasionally take 76 seconds the way apt did. Three runs of four shards in the image (35195497636): 4m36, 4m25, 4m32.
Why two workers and not four, or eight shards
playwright.config.tspinned CI to a single worker. The whole suite in one job, so nothing but the worker count differs:Then the shapes that follow, wall clock from first job start to last job end, merge job excluded:
Workers scale badly on their own, 24% for the second and 10% for the third and fourth, while separate runners scale well. Using two of each shard's four idle cores lands within 20 seconds of eight shards for six fewer runner minutes, which is what this takes. Eight shards is the faster shape if runner minutes are free, and past that the setup, ~50s of container and
npm ciplus ~15s of vite per job, is most of what a shard does.Flakiness follows the worker count rather than the shard count. The test that flakes in all three final runs is
NcDateTimePicker.spec.ts:179 › Pick a date, and it flakes at a single worker too, so it is not new here.Left on the table
mainand nightly rather than on every pull request would remove a third of the matrix. That is a coverage decision rather than a speed one.actions/setup-nodewithcache: npmwould takenpm cifrom 13–21s into single digits.Note
.github/workflows/playwright.ymlsays it comes from the organization template in nextcloud-libraries/.github. These changes make it diverge, and the next template sync will undo them unless the same edits land there.👾 This pull request was assisted by Claude Code, commits carry an
Assisted-bytrailer.