Skip to content

ci: shard the PR browser unit tests - #343816

Closed
Logan Ramos (lramos15) wants to merge 1 commit into
lramos15/split-remote-and-smoke-testsfrom
lramos15/split-browser-unit-and-agent-host-e2e
Closed

Logan Ramos (lramos15) wants to merge 1 commit into
lramos15/split-remote-and-smoke-testsfrom
lramos15/split-browser-unit-and-agent-host-e2e

Conversation

@lramos15

@lramos15 Logan Ramos (lramos15) commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

The browser unit tests took 8–10 min on one machine per OS. test/unit/browser/index.js gets a --testSplit <i>/<n> option like the Electron runner's, which deals out the test files in turn, and each OS runs <OS> (unit 1/2) / Browser and <OS> (unit 2/2) / Browser.

The Windows Agent Host E2E sharding that this PR first had moved down to #343812.

Saves: median −0.7 min (13.4 → 12.7), for 3 more jobs and about 24 more runner-minutes per run.

Validation

  • node test/unit/browser/index.js --browser chromium --testSplit 150/150 --reporter dot: 103 passing.
  • npm run eslint -- test/unit/browser/index.js: clean.
  • cd build && node --test lib/test/agentHostTestSelection.test.ts lib/test/detectChanges.test.ts lib/test/detectMissingCaches.test.ts: 22 passed.
  • actionlint on the changed workflows: nothing new.

Part of a stack to speed up PR CI

GitHub stack #343905: #343812 → #343813 → #343814 → #343815 → #343816 (#343817 is separate). Each PR shows only its own changes, and CI runs on every layer as if it targeted main.

Estimated cumulative savings, from replaying step timings of 60 PR runs (Oct 21–23):

PR Change Median p90 Extra runner-min / run
Today 22.6 32.6
#343812 Windows on 8-core larger runners, workspace on a Dev Drive, Agent Host E2E in 2 shards ~21–22 ~31 +15
#343813 Split Electron-Unit ~18 ~28 +15
#343814 Split Electron integration ~16 ~26 +23
#343815 More smoke and Remote shards ~13.5 ~23 +30
#343816 Shard the browser unit tests ~13 ~22.5 +24

Measured so far: one run of the whole stack, before the Dev Drive, took 18.4 min. Its Windows jobs lost 2.2–4.3 min each to restoring node_modules, which the Dev Drive fixes, and 2.3–3.1 min to a burst of six concurrent PR runs waiting for runners. The required <OS> / <job> checks don't change.

@lramos15
Logan Ramos (lramos15) changed the base branch from lramos15/split-remote-and-smoke-tests to main October 23, 2026 15:10
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-browser-unit-and-agent-host-e2e branch from 82ea4b4 to 79dd06f Compare October 23, 2026 19:28
Copilot AI balanced review requested due to automatic review settings October 23, 2026 19:28
@lramos15
Logan Ramos (lramos15) changed the base branch from main to lramos15/split-remote-and-smoke-tests October 23, 2026 19:29
@lramos15 Logan Ramos (lramos15) changed the title ci: shard the browser unit tests and the Windows Agent Host E2E tests ci: shard the PR browser unit tests Oct 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Invalid shard coordinates can produce a successful run without executing any tests.

1 open issue
What changed in this PR

This PR reduces browser unit-test time in VS Code’s pull-request CI by running two parallel shards per operating system.

Changes:

  • Adds --testSplit <i>/<n> to distribute browser test files round-robin.
  • Creates two browser unit-test jobs each for Linux, macOS, and Windows.
  • Passes shard coordinates through the reusable OS workflows.
File Description
test/​unit/​browser/​index.js Adds shard selection and CLI help.
.github/​workflows/​pr.yml Defines two browser unit-test shards per OS.
.github/​workflows/​pr-win32-test.yml Passes shard arguments to Chromium tests on Windows.
.github/​workflows/​pr-linux-test.yml Passes shard arguments to Chromium tests on Linux.
.github/​workflows/​pr-darwin-test.yml Passes shard arguments to WebKit tests on macOS.

Review effort: Balanced

Comment thread test/unit/browser/index.js Resolved
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-browser-unit-and-agent-host-e2e branch from 79dd06f to d20477d Compare October 23, 2026 21:35
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-remote-and-smoke-tests branch from dcfe9d3 to 94f7801 Compare October 24, 2026 21:36
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-browser-unit-and-agent-host-e2e branch from d20477d to 7fcc1f4 Compare October 24, 2026 21:36
The browser unit tests took 8 to 10 min per platform on one machine. The
browser test runner gets a --testSplit option, like the Electron one, and each
platform runs them in two shards. The runner rejects a part outside
1 <= i <= n, such as 3/2, which would select no test files and pass. Failed
tests are still rerun from their own files, and on macOS and Windows the split
divides only the test files that the unit test plan selects.

Co-authored-by: Copilot <[email protected]>
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-browser-unit-and-agent-host-e2e branch from 7fcc1f4 to 4b91a68 Compare October 25, 2026 13:17
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-remote-and-smoke-tests branch from 94f7801 to 43b58ea Compare October 25, 2026 13:17
@lramos15

Copy link
Copy Markdown
Member Author

Closing: this split doesn't shorten the run. Across 16 CI runs of the stack, the browser unit tests took 11–12.5 minutes unsplit on Linux (max 14.9), 10.9–12.1 on Windows (max 12.8) and about 9.6 on macOS (max 11.4). That's below the slowest job of the run, which with the rest of the stack is a Windows Agent Host E2E shard or the WSL smoke shard (median run time about 18.3 min). A Monte Carlo replay of the measured job times shows no change to the median or p90 with or without this split on any platform, so it would only add jobs and macOS/Windows runner minutes. The rest of the stack is in #343812 → #343813 → #343814 → #343815.

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