Skip to content

ci: run the Linux Electron and node.js unit tests on separate machines - #343813

Merged
Logan Ramos (lramos15) merged 1 commit into
lramos15/windows-large-runnersfrom
lramos15/split-electron-unit-tests
Oct 26, 2026
Merged

Logan Ramos (lramos15) merged 1 commit into
lramos15/windows-large-runnersfrom
lramos15/split-electron-unit-tests

Conversation

@lramos15

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

Copy link
Copy Markdown
Member

The Electron-Unit / Linux job ran the Electron unit tests and then the node.js unit tests on one machine. Linux runs every unit test on every push, so the job took 16.6 min (max 18.9), which could make it the last job of the run. It now runs as two parallel jobs:

  • Electron-Unit (electron) / Linux: the Electron unit tests, with main's --rerun-failed-files 2.
  • Electron-Unit (node) / Linux: the node.js unit tests, without setting up Electron.

Split, they take 12.1 and 5.7 min. A new unit_test_suite input (all, electron or node) of pr-linux-test.yml picks the steps. The default all keeps the current behavior, and the artifact names get the suite as a suffix so the two jobs don't collide. PR Gate requires both jobs.

macOS and Windows run only the unit test files that the test plan selects, so their unit test jobs are usually short. An earlier version of this PR also split Windows, but with the test selection that saved 0.2 min at the median and 0.5 at p90 for $0.12 more per PR, so it's gone.

Saves: with the rest of the stack, leaving this PR out adds 0.4 min to the median. Linux runners are free for this repository.

Validation

  • cd build && node --test lib/test/agentHostTestSelection.test.ts lib/test/detectChanges.test.ts lib/test/detectMissingCaches.test.ts lib/testAgentHostE2EStartup.test.ts: 30 passed.
  • actionlint on the changed workflows: nothing new.

Part of a stack to speed up PR CI

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

A split only helps if it shortens the job that finishes last in typical PRs, so the stack keeps only those. Run time in minutes is from replaying measured job times (20 CI runs of the stack and 56 PR runs of main), including the waits for Windows runners, over a mix of PRs that follows the test plan since #344146: on macOS and Windows, 72% of PRs run no node.js integration test, 20% some and 8% all; Agent Host E2E runs for about 25% on Windows and 42% on Linux; and about a quarter of PRs run every unit test. Cost is at GitHub list prices: Windows 8-core $0.042/min, macOS xlarge $0.102/min, and standard Linux runners are free for this repository.

Median p90 Jobs (avg) GitHub cost / PR
main (Windows on 1ES), weekday runner waits 21.6 27.6 27 $7.38 + 1ES
main (Windows on 1ES), weekend, no waits 18.0 22.4 27 $7.38 + 1ES
#343812: Windows on larger runners 21.1 24.9 28 $11.72
+ #343813: Linux unit test split 21.1 24.9 29 $11.72
+ #343814: Linux Agent Host E2E job 20.6 24.8 30 $11.71
+ #343815: Windows smoke and Remote splits 17.7 20.4 32 $12.07

With the whole stack, the job that finishes last is usually the WSL smoke shard on Windows (about 40% of PRs), then the Linux Remote job and the macOS unit tests. #343812 on its own is no faster than main at the median, so it should merge with the rest of the stack. Leaving out any one piece makes the run slower:

Without Median p90
Windows Agent Host E2E in 2 shards (#343812) +0.2 +4.6
Linux unit test split (#343813) +0.4 +0.0
Linux Agent Host E2E job (#343814) +0.6 +2.2
Windows smoke 3rd shard (#343815) +1.0 +4.3
Windows Remote split (#343815) +1.6 +0.9

Earlier versions of the stack also split the macOS jobs, the Linux smoke and Remote tests, the browser unit tests (#343816, closed), the Windows unit tests and the Windows integration tests, and halved some test suites with --testSplit. Since #344146, macOS and Windows run few integration tests in most PRs, and none of those splits changed the median by more than 0.2 min or p90 by more than 0.5 min, so they're gone: for a PR that runs everything, that's 22 fewer jobs and about $4 less than the first version.

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.

🔵 Needs a closer look

Human approval should confirm cross-platform CI results and failure propagation through the required checks.

No open issues 🎉

What changed in this PR

This PR shortens VS Code’s unit-test CI path by splitting each operating system’s Electron-Unit check into two Electron shards and a separate Node.js job.

Changes:

  • Adds three parallel unit-test jobs per OS while preserving required check names.
  • Introduces suite and shard inputs, retaining failed-file retries.
  • Separates artifact names and skips Electron setup for Node.js-only jobs.
File Description
.github/​workflows/​pr.yml Defines the three-part unit-test matrix for each OS.
.github/​workflows/​pr-win32-test.yml Adds Windows suite routing, sharding, and distinct artifact names.
.github/​workflows/​pr-linux-test.yml Adds Linux suite routing, sharding, and distinct artifact names.
.github/​workflows/​pr-darwin-test.yml Adds macOS suite routing, sharding, and distinct artifact names.

Review effort: Balanced

@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-electron-unit-tests branch 2 times, most recently from 08e43b3 to 0ce9f76 Compare October 24, 2026 21:36
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-electron-unit-tests branch from 0ce9f76 to 8c6ebd8 Compare October 25, 2026 13:17
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-electron-unit-tests branch from 8c6ebd8 to a60ee9e Compare October 25, 2026 14:43
@lramos15 Logan Ramos (lramos15) changed the title ci: split the Electron-Unit PR checks into three parallel jobs ci: run the Electron and node.js unit tests on separate machines on Linux and Windows Oct 25, 2026
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-electron-unit-tests branch from a60ee9e to 5f7c777 Compare October 25, 2026 17:14
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-electron-unit-tests branch from 5f7c777 to 52d2371 Compare October 25, 2026 18:07
@lramos15 Logan Ramos (lramos15) changed the title ci: run the Electron and node.js unit tests on separate machines on Linux and Windows ci: run the Linux Electron and node.js unit tests on separate machines Oct 25, 2026
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/split-electron-unit-tests branch 2 times, most recently from c52202f to 6445256 Compare October 25, 2026 23:05
The Linux Electron-Unit job ran the Electron unit tests and then the node.js
unit tests on one machine. Linux runs every unit test on every push, so the job
(16.5 min) could be the slowest of the workflow. It now runs the two suites in
separate jobs, and the node.js part skips setting up Electron. macOS and
Windows run only the unit tests that the test plan selects, and split, they
would save too little for the extra runners.

Co-authored-by: Copilot <[email protected]>
@lramos15
Logan Ramos (lramos15) merged commit 5d04087 into main Oct 26, 2026
48 checks passed
@lramos15
Logan Ramos (lramos15) deleted the lramos15/split-electron-unit-tests branch October 26, 2026 14:29
@vs-code-engineering vs-code-engineering Bot added this to the 1.145.0 milestone Oct 26, 2026
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.

3 participants