From 271d80ee331b1e20543479a14bd538f49b8a4be9 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Thu, 17 Sep 2026 09:13:53 +0200 Subject: [PATCH 1/4] ci: split the Playwright run over four shards 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 --- .github/workflows/playwright.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index b86002f3e2..b25ad032a6 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -24,8 +24,8 @@ jobs: strategy: fail-fast: false matrix: - shardIndex: [1, 2] - shardTotal: [2] + shardIndex: [1, 2, 3, 4] + shardTotal: [4] outputs: node-version: ${{ steps.versions.outputs.node-version }} package-manager-version: ${{ steps.versions.outputs.package-manager-version }} From 1b812b1d3fecd3c0efd98640a140b87849fa9571 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Thu, 17 Sep 2026 09:32:06 +0200 Subject: [PATCH 2/4] ci: run the Playwright shards in the Playwright image 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 --- .github/workflows/playwright.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index b25ad032a6..42dc58411f 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -21,6 +21,12 @@ jobs: playwright-tests: timeout-minutes: 60 runs-on: ubuntu-latest + # Ships the browsers and the system libraries they need, which is the + # `playwright install --with-deps` step this job used to run. The tag + # has to match the `playwright-core` version resolved by the lockfile, + # or Playwright downloads a second set of browsers at runtime. + container: + image: mcr.microsoft.com/playwright:v1.62.1-noble strategy: fail-fast: false matrix: @@ -50,9 +56,6 @@ jobs: - name: Install dependencies run: npm ci - - name: Install Playwright browsers - run: npx playwright install --with-deps - - name: Run Playwright tests run: npm run test:component -- --shard='${{ matrix.shardIndex }}/${{ matrix.shardTotal }}' From 25f0466acfcc3f802d17b673eb76b9d49fe8e449 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Thu, 17 Sep 2026 09:37:47 +0200 Subject: [PATCH 3/4] ci: point HOME at root inside the Playwright image 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 --- .github/workflows/playwright.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 42dc58411f..4b6e1a805f 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -27,6 +27,11 @@ jobs: # or Playwright downloads a second set of browsers at runtime. container: image: mcr.microsoft.com/playwright:v1.62.1-noble + env: + # The steps run as root while the runner's own /github/home belongs + # to the image's pwuser, and Firefox refuses to launch when $HOME is + # owned by somebody else + HOME: /root strategy: fail-fast: false matrix: From 96e9be5f255221c04b43db08599aed4ce323295b Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Thu, 17 Sep 2026 10:22:24 +0200 Subject: [PATCH 4/4] test: give the CI run a second worker 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 --- playwright.config.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index c8c0253707..112ff17e6d 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -44,8 +44,11 @@ export default defineConfig({ forbidOnly: !!process.env.CI, /* Retry on CI only */ retries: process.env.CI ? 2 : 0, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, + /* Two of the runner's four cores on CI, which is where the suite stops + scaling: measured over the whole suite, one worker takes 6m19, two + take 4m49 and four take 4m22, and four workers is also where a + second test starts flaking. */ + workers: process.env.CI ? 2 : undefined, // On CI we are using the github annotations + blob which will be merged by workflow to a downloadable HTML report (like the one we receive locally) reporter: process.env.CI ? 'blob' : 'html',