Skip to content

CI: the queue reuses a pull request's passing results, and no browser job outlasts the unit shards - #2986

Merged
davidmckayv merged 23 commits into
mainfrom
ci/one-full-run-per-pr
Dec 5, 2026
Merged

davidmckayv merged 23 commits into
mainfrom
ci/one-full-run-per-pr

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

What this changes

Every pull request paid for the full suite twice (once on the PR, again in the merge queue), and the browser jobs were the long pole of each run: on 4 December the WebKit shards took 8.5 to 15.6 minutes and the desktop setup window 10 to 11, against 3.6 to 6.2 for the unit shards (PR run, merge-queue run).

1. Dusty's #2784, carried onto main. His 18 commits keep their authorship (merged, not squashed), with the conflicts against what main gained since (#2907's renderer-crash test, #2913's byEngine) resolved:

  • The merge queue reuses a pull request's passing results when the tree it would test is the one they passed on, and otherwise runs only what changed since a pass.
  • The cross-browser list runs Chromium and WebKit as separate legs, three shards each, so no file runs the same browser twice.
  • byEngine takes the files the WebKit rule owes, and leaves out a changed file the cross-browser job already runs in full.
  • select-scrolls-layout runs its Chromium cases in the Chromium leg and its WebKit cases in the WebKit leg. Taken as either side alone, its WebKit cases would have run nowhere.
  • The renderer-crash rule now reads the leg's $BROWSER_ENGINE. Before this, it no longer saw the WebKit list at all.
  • .github/ci-budgets.json and scripts/ci-budgets.test.ts are as Dusty wrote them.

2. Bun's own selection, where it helps.

  • --timings / --update-timings (adopted). Each engine's shards are now cut by that engine's recorded per-file durations (scripts/browser-timings/<engine>.json), not dealt out alphabetically. Each worker starts its slowest file first, and each shard uploads what its files took. bun scripts/browser-timings.ts <run id> merges a run's shards into a fresh record. ci-changes.ts still proves a full job covers its list with the record in its command, because a record every shard of an engine reads alike only moves files between shards. A record whose path differs by shard is no proof, and a test pins both cases.
  • --changed (checked, not adopted). A probe on Bun 1.4.4 shows it follows static imports transitively, including JSON imports. It misses a fixture read by its path and a change to bunfig.toml. ci-changes.ts's hand-rolled search (mentions, a git grep for a path) exists exactly for tests that name a doc or file by path, and today the partial mode only ever sees test and doc changes, since any code change runs the whole suite. No test imports another test, so --changed would find nothing mentions misses, and would miss what it finds. Using it to shrink the suite on code changes would need the suite's pass-proof and count floor reworked, so it stays out.

3. Browser legs levelled.

  • artifacts-screens.test.tsx, the 11-minute file that set the slowest shard's floor: what its describes share moved to artifacts-screens.harness.ts. Its layout cases (9 of its 11 minutes) are dealt every fourth over artifacts-screens-layout-1..4.test.tsx. Still 190 tests. A suite test fails if a layout file goes missing or deals the wrong part.
  • The desktop setup window: its one 7,750-line file ran 293 tests in about 10 minutes. It is three files now, sharing setupLayout.browser.harness.ts: the move to OpenBot Cloud (about 3 min), the approved layouts and too-old screens (about 3 min), and the rest (about 3.5 min). The job runs them with --parallel. Still 293 tests, and the WebKit -t step is unchanged.
  • Shard count stays at three per engine. A simulation over the measured per-file times of three runs (time-balanced shards of 8 workers) puts each Chromium shard at about 4.5 minutes of tests and each WebKit shard at about 5.5. Four to eight shards change nothing, because the floor is then the longest single file: moved-apps-reconnect at about 5.5 minutes in WebKit. That is within a minute of the slowest unit shard, so it is left whole.

4. Merge-queue settings (ruleset 28439267, not changed here). Today: ALLGREEN, build 4, merge 4, minimum 1, no wait, status timeout 120 minutes. The brief had build 2 and merge 2, so it was raised since. Nothing measured here points to another setting moving pull requests through faster. The 4 December delays were WebKit flakes ejecting entries and 13-to-15-minute runs, which slices A and B address, not the queue's shape. One optional change: lower the status-check timeout from 120 to 60 minutes. The longest job is capped at 30, and runner waits ran to 24, so a group whose checks never report would free the queue in an hour, not two.

Where it runs

GitHub Actions, the CI scripts and the browser test files (split, not changed in what they check). No app, server, API, database, signing or release-policy change.

Best practice consulted (searched 2026-12-04)

Proof

  • bun test on the CI scripts and engine tests (ci-changes, ci-run-tests, ci-budgets, browser-timings, workflow-concurrency, release-publish-order, release-ci-gate, test-floor, browser-engines, renderer-crash, artifacts-screens): 281 pass, 0 fail.
  • Test counts are unchanged across the splits: artifacts 190, plus the new part guard; desktop 293.
  • bun run lint, bun run format:check, bun run typecheck and the desktop's typecheck all pass.
  • actionlint: no new findings. Its 19 existing ones are the $/.github/actions/... references main has too.
  • zizmor: no findings.
  • A bug found on the way: the suite's realMentions helper ran git grep with no pattern when given no paths, as ci-changes.ts never does. It now returns nothing, as the real code does.
  • Browser suites run in hosted CI. Per-leg timings on this PR are in a comment below.

Carries #2784 by @dustywusty.

Changelog

none

dustywusty and others added 22 commits December 2, 2026 03:06
- Only the full-ci label cancels and replaces a pull request's CI run.
  Any other label waits for the run in progress, then finds its checks
  passed on the same commit and skips them. A label run cannot skip
  everything up front: a skipped verify counts as passing.
- 14 files in the cross-browser list ignored the engine selection and
  ran in full in both the Chromium and the WebKit leg, artifacts-screens
  (about 11 minutes) among them. They now run where Chromium is selected
  (ownBrowsersAsked), once. sidebar-window-buttons launches through
  launchBrowserEngines. A test holds every listed file to the selection.
- A full browser job that runs covers the changed files in its list, so
  they no longer run a second time in tests (changed files). The desktop
  setup window's step names its file in a list the planner can read.
- The queued pull request's head is fetched on a deadline of its own,
  and a merge group that has to go without its history says why.
- The budget test builds matrix legs as GitHub does: include and
  exclude are lists of legs, not axes.
- Comments and docs/releasing.md name the engine and shard checks.
Conflicts: byEngine (from #2913) now takes the files the WebKit rule owes and drops a changed file the cross-browser job already runs; WebKit files keep renderer-crash's test alongside browser-engines; select-scrolls runs its Chromium cases in the Chromium leg and its WebKit cases in the WebKit leg; the renderer-crash rule reads the matrix's BROWSER_ENGINE.
artifacts-screens.test.tsx took about 11 minutes in Chromium, nine of them its layout cases, and
as one file it set the length of its shard and so of every run. What its describes share moves to
artifacts-screens.harness.ts; the flows stay in the file, and the layout cases (each screen in
light and dark, wide, narrow and on a phone) are dealt every fourth over
artifacts-screens-layout-1..4.test.tsx, so the browser jobs run them side by side. The same 190
tests run; a suite test fails if a layout file goes missing or deals the wrong part.
…ide by side

The window's one test file ran its 293 tests one after another for about ten minutes, the longest
job of a run. What its describes share moves to setupLayout.browser.harness.ts, the move to
OpenBot Cloud (about three minutes) and the approved layouts with the too-old screens (about three)
move to files of their own, and the job runs the three with --parallel. The WebKit run of the key
field and tab row stays on setupLayout.browser.test.ts.
`bun test --shard` dealt the sorted list out in turn, so slow files piled up on one runner: on
4 December one WebKit shard took 15.6 minutes and another 9.4. Each engine's shards now read that
engine's record (scripts/browser-timings/<engine>.json, seeded from the last three runs' WebKit
logs) with --timings, so they take about as long as each other and each worker starts its slowest
file first. Each shard writes its own durations over the record and uploads them;
`bun scripts/browser-timings.ts <run id>` merges them into a fresh record.

ci-changes.ts still proves a full job covers its list with the record in its command: a record
every shard of an engine reads alike only moves files between shards. One whose path differs by
shard is no proof.

The desktop setup window's job runs its three files with --parallel. The suite's test helper
for `mentions` returns nothing for no paths, as ci-changes.ts does: git took the first pathspec
for the pattern, and a comment naming a wildcard test file made a CHANGELOG-only group run tests.
CONTRIBUTING says the queue reuses checks that already passed.
Refreshed with scripts/browser-timings.ts from this branch's first run (47475884691), where each engine ran in its own legs: the seed split each file's time by its tests' names.
@davidmckayv

Copy link
Copy Markdown
Contributor Author

Timings on this PR's first full run (47475884691), against 4 December's baseline (PR run 47457434745):

Leg Before This PR
WebKit shards 9.4 / 11.3 / 15.6 min 4.1 / 5.0 / 5.1 min
Chromium shards (new) (inside the WebKit shards) 6.1 / 5.8 / 5.3 min
Desktop setup window 10.4 min 4.3 min
app (real browser) 5.8 min 5.3 min
Unit shards (slowest) 6.2 min 5.9 min
Whole run 16.5 min 8.1 min

The slowest browser leg (Chromium shard 1, 6.1 min) is within 0.2 min of the slowest unit shard. Every shard uploaded its own durations. I then refreshed scripts/browser-timings/ from those with bun scripts/browser-timings.ts 47475884691, in place of the seed's estimated engine split, and pushed. The longest file is now moved-apps-reconnect at about 4.9 min in Chromium.

@davidmckayv
davidmckayv merged commit 38815af into main Dec 5, 2026
8 checks passed
@davidmckayv
davidmckayv deleted the ci/one-full-run-per-pr branch December 5, 2026 04:05
ataibarkai pushed a commit that referenced this pull request Dec 5, 2026
Main split setupLayout.browser.test.ts into its own files (#2986); this
branch's changes to those tests now sit in the files the tests moved to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012xYtaRm1VTLHW6QMDUMASK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants