From 5aec6a27c40f6724f22b84b27e18b1a79df0751c Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Thu, 5 Nov 2026 14:09:59 +1100 Subject: [PATCH] ci: split Vitest across six shards so 3/4 stops hitting the job cap JavaScript 3/4 ran past its 10-minute cap and was cancelled 29 times between 2026-11-04 01:38Z and 2026-11-05 02:48Z, out of 842 runs of that shard that finished or hit the cap. Every test had passed in the three cancellations we read, so a cancellation fails CI required on a PR that was green. No other shard has hit the cap: 3/4 runs p50 8.7 and p90 9.7 minutes, against 7.0 to 7.5 for the others. Vitest splits files by path hash into equal-count slices, so 3/4 holds store-discovery.test.ts, SearchResults.test.tsx and service.test.ts, three of the slowest files. A copy of vitest 5.0.4's split reproduces main's four shards exactly. With median per-file times from four main runs, it projects the slowest Vitest step at 404 s for four shards, 372 s for five, 274 s for six and 286 s for seven. Six is the smallest count that clears the cap with room on a slower runner. The cap and CI required are unchanged: the required job reads needs.javascript.result, which covers every matrix entry, and main's ruleset requires only CI required and DCO Check. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Matt Toohey --- .github/workflows/ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 586d4d53a8..22f9fb51c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,13 +21,16 @@ env: jobs: javascript: if: github.event_name != 'workflow_dispatch' - name: JavaScript (${{ matrix.shard }}/4) + name: JavaScript (${{ matrix.shard }}/6) runs-on: ubuntu-24.04 + # Vitest shards by path hash and equal file count, not duration, so slow + # files can share one. Six keeps the slowest well inside this deadline on + # slower runners; five barely moves it, and seven is slower than six. timeout-minutes: 10 strategy: fail-fast: false matrix: - shard: [1, 2, 3, 4] + shard: [1, 2, 3, 4, 5, 6] steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: @@ -42,7 +45,7 @@ jobs: env: # Bound contention between suites that sign and verify large fixtures. BUZZ_TEST_WORKERS: "2" - run: ./bin/node scripts/ci-test-report.mjs kind=vitest report=test-results/ci/vitest.json evidence=test-results/ci/vitest-timing.json title="Vitest shard ${{ matrix.shard }}/4" -- ./bin/pnpm exec vitest run --shard=${{ matrix.shard }}/4 --reporter=default --reporter=json --outputFile=test-results/ci/vitest.json + run: ./bin/node scripts/ci-test-report.mjs kind=vitest report=test-results/ci/vitest.json evidence=test-results/ci/vitest-timing.json title="Vitest shard ${{ matrix.shard }}/6" -- ./bin/pnpm exec vitest run --shard=${{ matrix.shard }}/6 --reporter=default --reporter=json --outputFile=test-results/ci/vitest.json - name: Vitest timing evidence if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4