Skip to content

test: run the extension host integration test suites in parallel - #345867

Merged
Logan Ramos (lramos15) merged 3 commits into
mainfrom
test/parallel-integration-suites
Nov 3, 2026
Merged

Logan Ramos (lramos15) merged 3 commits into
mainfrom
test/parallel-integration-suites

Conversation

@lramos15

@lramos15 Logan Ramos (lramos15) commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Part of an effort to speed up the PR checks. The extension host integration scripts launch VS Code once per suite, one suite after another, and most of a suite's time is that launch:

Linux, recent run Suites Step time Test time the suites report
Extension host tests (test-integration.sh --only-extension-host-tests) 17 180s 75s
Remote integration (test-remote-integration.sh) 8 185s 92s

On Linux, 9 of the 17 extension host suites take 5–6s, which is about one launch. The longest suites are API tests (folder) at 45s (67s remote), Colorize at 30s, Emmet at 21s (37s remote), and Git at 12s (33s remote). On macOS, remote integration (~167s) runs inside macOS / Remote, the job that finishes last in most PR runs.

Changes

  • New scripts/integration-test-suites.sh, sourced by both scripts. Suites are registered with add_suite <group> <name> <estimated seconds> <title> <function> and run with run_suites.
    • Default (unchanged): suites run one after another in the same order, and the first failure stops the run.
    • INTEGRATION_TEST_PARALLEL=<lanes>: up to <lanes> suites run at once, longest groups first, pulled from a queue. Each suite gets its own --user-data-dir and --logsPath. Two instances sharing a user data folder would hand off to each other and exit, and @vscode/test-electron otherwise uses one shared .vscode-test/user-data. Remote suites also get their own test-resolver server data and logs folders; the server already uses --port=0.
    • Each suite's output is printed in one block when it finishes, with its duration. A failing suite stops at its first failing command, the others continue, and the run fails at the end with an ::error for each failed suite.
    • API tests (folder) and API tests (workspace) change the same workspace folder, so they stay in one lane.
    • Parallel mode refuses INTEGRATION_TEST_APP_NAME, whose killall would quit the other lanes' apps.
  • scripts/test-integration.sh and scripts/test-remote-integration.sh are refactored into suite functions. Commands, order and --suite filtering are unchanged.
  • The Linux and macOS PR jobs set INTEGRATION_TEST_PARALLEL to 2 on the extension host and remote integration steps.
  • The per-suite folders live under a short /tmp/vscode-it.XXXXXX folder: under the macOS $TMPDIR, the main IPC socket path in the user data folder exceeded the 103-character limit and that instance failed to start.
  • Not covered yet: Windows (.bat scripts), and web integration, whose server listens on a fixed port 8000.

Results

The first run used 4 lanes on Linux and 3 on macOS. On an 8-core runner, 4 lanes slowed each instance down so much that it barely helped: the Linux extension host step went from 161s to 128s, but the API tests went from 30s to 2 minutes, so browser tools and run_in_terminal timed out waiting 10s for their tools to register. With 2 lanes, every check passes:

Step 5-day median (p25) 2 lanes
Linux / Electron (extension host): 🧪 Run extension host integration tests (Electron) 212s (174s) 105s
macOS / Electron: 🧪 Run extension host integration tests (Electron) 185s (176s) 106s
Linux / Remote (integration): 🧪 Run integration tests (Remote) 225s (198s) 148s
macOS / Remote: 🧪 Run integration tests (Remote) 166s (158s) 124s

That is about 40–100s per step from one run. The 2-lane run also failed PolicyExport Integration Tests in Windows / Electron. This PR doesn't change any Windows files, and the same test passed on #345871 at the same base, and the rerun of that job passed it, so it was a flake.

Validation

  • A local harness with fake suites (sleeps, one failure, a shared group), under the macOS default bash 3.2: groups stay in order within one lane, a failing suite stops at its first failing command, the others finish, the run exits 1 with an ::error, and sequential mode behaves as before.
  • bash -n on all three scripts: OK
  • cd build && node --test lib/test/detectChanges.test.ts lib/test/agentHostTestSelection.test.ts: 27/27 pass
  • actionlint: clean

Most of an extension host suite is starting VS Code: on Linux, 9 of the 17 suites of the extension host tests take 5-6s, and the scripts launch the suites one after another (180s on Linux, 185s for the remote suites). With INTEGRATION_TEST_PARALLEL=<lanes>, scripts/test-integration.sh and scripts/test-remote-integration.sh run up to that many suites at a time, the longest first, each with its own user data, logs and test resolver folders, and print each suite's output when it finishes. The API tests of a folder and a workspace change the same folder, so they stay in one lane. Without the variable, the suites run one after another as before.

The Linux and macOS PR jobs run 4 and 3 lanes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 3, 2026 17:47

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

Parallel execution can falsely report success by ignoring lane failures, race on shared Electron rebuilds, and incorrectly attribute extension-suite failures to previously passed node.js tests.

3 open issues
What changed in this PR

This PR adds optional parallel execution to VS Code’s Linux and macOS extension-host integration suites to reduce PR check times, while retaining sequential execution by default.

Changes:

  • Adds a shared, group-aware scheduler with per-suite data directories, buffered output, and failure reporting.
  • Refactors local and remote integration scripts into registered suite functions.
  • Enables four lanes in Linux PR jobs and three on macOS, and documents local usage.
File Description
scripts/​test-remote-integration.sh Registers remote suites and isolates their client and server directories.
scripts/​test-integration.sh Registers local suites while preserving filtering and isolating parallel user data.
scripts/​integration-test-suites.sh Adds sequential and parallel scheduling, grouped execution, and result reporting.
.github/​workflows/​pr-linux-test.yml Enables four parallel lanes for extension-host and remote tests.
.github/​workflows/​pr-darwin-test.yml Enables three parallel lanes for extension-host and remote tests.
.github/​skills/​integration-tests/​SKILL.md Documents the parallel execution option.

Review effort: Balanced

Comment thread scripts/integration-test-suites.sh Resolved
Comment thread scripts/integration-test-suites.sh Resolved
Comment thread scripts/integration-test-suites.sh Resolved
4 lanes on an 8-core runner slowed the API tests from 30s to 2 minutes, so their 10s tool registration waits timed out. On macOS, the per-suite user data folders under $TMPDIR made the IPC socket path longer than 103 characters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Base: 84e9ae6a Current: 7bc72663

No screenshot changes.

…gration runs

Without VSCODE_SKIP_PRELAUNCH, each launch could download Electron again while another lane ran it. A lane that stopped before its suites finished was ignored, and the EXIT trap blamed a failing parallel suite on the node.js integration tests that ran before.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lramos15
Logan Ramos (lramos15) merged commit 6c8dc62 into main Nov 3, 2026
99 of 101 checks passed
@lramos15
Logan Ramos (lramos15) deleted the test/parallel-integration-suites branch November 3, 2026 20:47
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 3, 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.

4 participants