[GH-ISSUE #5622] Speed up the browser CI matrix: shard the lanes, build once, and skip on unrelated PRs #3112

Closed
opened 2026-10-21 05:59:42 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Aug 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5622

Originally assigned to: @kolacheee on GitHub.

What happens

The Release Regression Matrix (playwright.yml) takes 15–21 minutes per browser lane on every PR — mobile-chromium ~15 min, mobile-webkit ~20 min — regardless of what the PR touches. A docs-only or installer-only PR waits the same 20 minutes as a client rewrite.

Why it's slow today (verified against the current workflow/config)

  • Each lane runs the full ~103-test core-flows.e2e.ts suite serially in a single worker: fullyParallel: false in playwright.config.ts (deliberate — tests share one app server's mutable fixtures within a run), one job per browser.
  • The workflow has no path filtering: on: pull_request / push to staging, nothing else.
  • Each of the three jobs independently does its own install + client/server build before testing.
  • WebKit-on-Linux is inherently slower, and the two known flaky tests (#5618) add retry time — a 19-second test retried five times is ~1.6 wasted minutes per affected run.

Proposed work, in order of impact

  1. Shard each browser lane (--shard=1/3 or 1/4 as extra matrix dimensions). This sidesteps the fullyParallel: false constraint cleanly: that setting guards test isolation within one run's shared server, but each shard job is its own runner booting its own server, so shards need no test-level isolation. 3 browsers × 3 shards ≈ ~6 minute wall time; ×4 approaches 5. Cost: more total runner-minutes (parallel), plus a blob-report merge step if unified reports are wanted.
  2. Build once, reuse: a single build job uploads the built client/server as an artifact; browser jobs download instead of rebuilding. Compounds with sharding (9–12 jobs would otherwise each rebuild).
  3. Cache Playwright browsers (~/.cache/ms-playwright, keyed on the lockfile) if not already cached — the WebKit download alone is worth 1–2 min/job. (pnpm is already cached.)
  4. Skip gate for genuinely unrelated PRs: a cheap change-detection job (dorny/paths-filter or git diff --name-only) that the browser jobs needs:/if: on. Two constraints:
    • Do not use a workflow-level paths: filter if these are required checks — a skipped workflow leaves required checks stuck as "Expected" and blocks merging. The in-workflow gate keeps the jobs reporting green in seconds instead.
    • The safe skip-list is narrow, because the suite boots the real server and client, so server changes can break it. Genuinely skippable: docs/**, **/*.md, CHANGELOG.md, win/installer/**, android/** (WebView shell), scripts/regressions/** (has its own lane), and workflow files outside the matrix itself. That covers the docs-i18n mirrors, installer, and launcher-adjacent PRs where the wait is most pointless.

Optional policy variant (separate decision): tag a fast smoke subset for PRs (~3–4 min) and keep the full matrix on staging pushes (already running) plus a nightly. Full coverage would still gate what ships, but red lanes would surface post-merge — which cuts against the never-merge-over-red discipline #5589 restored, so this one deserves an explicit maintainer call rather than riding along.

Also worth doing first for free minutes: fixing the two #5618 flakes trims the retry waste out of every affected run.

Scope: contained to .github/workflows/playwright.yml plus a report-merge step; no test-content changes required for items 1–4.

Originally created by @kolacheee on GitHub (Aug 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5622 Originally assigned to: @kolacheee on GitHub. **What happens** The Release Regression Matrix (playwright.yml) takes 15–21 minutes per browser lane on every PR — mobile-chromium ~15 min, mobile-webkit ~20 min — regardless of what the PR touches. A docs-only or installer-only PR waits the same 20 minutes as a client rewrite. **Why it's slow today** (verified against the current workflow/config) - Each lane runs the full ~103-test `core-flows.e2e.ts` suite **serially in a single worker**: `fullyParallel: false` in playwright.config.ts (deliberate — tests share one app server's mutable fixtures within a run), one job per browser. - The workflow has **no path filtering**: `on: pull_request / push` to staging, nothing else. - Each of the three jobs independently does its own install + client/server build before testing. - WebKit-on-Linux is inherently slower, and the two known flaky tests (#5618) add retry time — a 19-second test retried five times is ~1.6 wasted minutes per affected run. **Proposed work, in order of impact** 1. **Shard each browser lane** (`--shard=1/3` or `1/4` as extra matrix dimensions). This sidesteps the `fullyParallel: false` constraint cleanly: that setting guards test isolation *within one run's shared server*, but each shard job is its own runner booting its own server, so shards need no test-level isolation. 3 browsers × 3 shards ≈ **~6 minute wall time**; ×4 approaches 5. Cost: more total runner-minutes (parallel), plus a blob-report merge step if unified reports are wanted. 2. **Build once, reuse**: a single build job uploads the built client/server as an artifact; browser jobs download instead of rebuilding. Compounds with sharding (9–12 jobs would otherwise each rebuild). 3. **Cache Playwright browsers** (`~/.cache/ms-playwright`, keyed on the lockfile) if not already cached — the WebKit download alone is worth 1–2 min/job. (pnpm is already cached.) 4. **Skip gate for genuinely unrelated PRs**: a cheap change-detection job (`dorny/paths-filter` or `git diff --name-only`) that the browser jobs `needs:`/`if:` on. Two constraints: - **Do not use a workflow-level `paths:` filter** if these are required checks — a skipped workflow leaves required checks stuck as "Expected" and blocks merging. The in-workflow gate keeps the jobs reporting green in seconds instead. - The safe skip-list is **narrow**, because the suite boots the real server and client, so server changes can break it. Genuinely skippable: `docs/**`, `**/*.md`, `CHANGELOG.md`, `win/installer/**`, `android/**` (WebView shell), `scripts/regressions/**` (has its own lane), and workflow files outside the matrix itself. That covers the docs-i18n mirrors, installer, and launcher-adjacent PRs where the wait is most pointless. **Optional policy variant** (separate decision): tag a fast smoke subset for PRs (~3–4 min) and keep the full matrix on staging pushes (already running) plus a nightly. Full coverage would still gate what ships, but red lanes would surface post-merge — which cuts against the never-merge-over-red discipline #5589 restored, so this one deserves an explicit maintainer call rather than riding along. **Also worth doing first for free minutes**: fixing the two #5618 flakes trims the retry waste out of every affected run. Scope: contained to `.github/workflows/playwright.yml` plus a report-merge step; no test-content changes required for items 1–4.
Author
Owner

@kolacheee commented on GitHub (Aug 29, 2026):

Taking items 1–4 (kolacheee, agent-assisted) in a single workflow PR: shard the lanes, build once + artifact reuse, Playwright browser cache, and the in-workflow skip gate. The smoke-subset policy variant is explicitly out of scope per maintainer decision. PR incoming.

<!-- gh-comment-id:5462189271 --> @kolacheee commented on GitHub (Aug 29, 2026): Taking items 1–4 (kolacheee, agent-assisted) in a single workflow PR: shard the lanes, build once + artifact reuse, Playwright browser cache, and the in-workflow skip gate. The smoke-subset policy variant is explicitly out of scope per maintainer decision. PR incoming.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3112
No description provided.