Repository navigation
perf(ci): use four Vitest workers on hosted runners - #10399
Conversation
Hosted CI jobs own a four-core runner but the suite ran on two workers. Other hosts keep the two-worker bound because they are shared. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The code appears safe to merge; no actionable defect was found. SummaryRaises the Vitest worker cap from two to four when
Acknowledged by Supersession could not be checked because GitHub access required authentication. Tests were not run. Reviews (1) · Last reviewed commit: "perf(ci): use four Vitest workers on hos..." · Reviewed by Greptile |
Summary
Portable test shards dominate PR CI time. Hosted jobs own a four-core runner, but every Vitest project is capped at two workers. This raises the cap to four on GitHub Actions only, as a measured trial. Draft until this PR's own CI run provides the comparison.
Problem and expected behavior
Baseline, fast-tier run 43460768388 (executed, observed):
npm citook under 30 seconds per shard, so the time is test execution.Expected: shard and source-test job time drops on the same runners with no new failures.
Change and scope
vitest.config.ts:MAX_TEST_WORKERSismin(4, availableParallelism())whenGITHUB_ACTIONS=true, otherwise unchanged atmin(2, ...).process-boundarystays serial (fileParallelism: false).maxWorkersas its lane width, so allocation follows the new cap. Recorded history was measured under two workers and refreshes after the next default-branch run.The cap was set to two in f47ee1a, citing descriptor pressure from boundary subprocesses.
docs/development/testing.mdrecords an earlier six-file acceptance sample that went from 96–101s to 71s at four workers. That sample is bounded by its longest file; a full shard has hundreds of files.Contribution scope: not applicable (test runner configuration within existing boundaries).
Contract and boundary impact
Semantic owner and earliest changed stage:
vitest.config.tsowns the worker budget; consumers are the Vitest projects andtests/ciTestSequencer.ts.Contribution scope fit and linked maintainer decision: not applicable.
CLI and MCP/tool-catalog contract: none.
Provider, bridge, target-format, or platform compatibility: none. Windows and macOS CI lanes also read
GITHUB_ACTIONSand may use up to their core count for their focused test files.Evidence, artifact, provenance, or reconstruction contract: none.
Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
Generated metadata, package, or installation impact: none.
Read existing files or captured data.
Launch or attach to a process.
Inject instrumentation or run scripts/code.
Change process memory, registers, files, or configuration.
Contact network services.
Recover protected code or work around protections.
Documentation or usability only; no target interaction.
Not sure yet; investigation or maintainer guidance needed.
Evidence and regression coverage
Validation performed
npm run check:fast— typecheck and lint passed (2 tasks successful).GITHUB_ACTIONS=true npx vitest run --project evaluation --project composition— 55 files, 933 tests passed, 2 skipped (local macOS, Node 24.22.1; confirms the config resolves, not a CI timing).npx prettier --check vitest.config.ts docs/development/testing.md— passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.🤖 Generated with Claude Code