Repository navigation
perf(tests): run source test projects in forked workers - #11016
Merged
morluto merged 1 commit intoNov 15, 2026
Merged
Conversation
Thread workers of the source lane share one process, which grew to 3.8-5.0 GiB; forked workers keep each heap separate so the largest process stays near 1.2-1.8 GiB.
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. |
Contributor
[Medium impact] The PR appears safe to merge; no blocking issue was found. SummaryMoves five source test projects from threads to forked workers. Worker limits and module sharing stay unchanged.
Reviews (2) · Last reviewed commit: "perf(tests): run source test projects in..." · Reviewed by Greptile |
22 tasks
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…tions (#11005) * perf(mcp): advertise large output union alternatives as shared definitions inspect_analysis_view's advertised output schema held every view result inline in one union definition, which the MCP SDK's default validator compiled into one function: about 1.7 s CPU and 500 MiB peak. Large union alternatives now become definitions of their own and identical definitions are merged, at the owning output projection. Tests that check results against the advertised output contract now compile that schema instead of a separate inline projection, which overflowed the main-thread stack under forked workers. * perf(tests): run source test projects in forked workers (#11016) Thread workers of the source lane share one process, which grew to 3.8-5.0 GiB; forked workers keep each heap separate so the largest process stays near 1.2-1.8 GiB. * test(mcp): select the analysis view contract from its family
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The source test lane (
npm run test:fast: domain, services, adapters, composition, conformance and evaluation) ran five of its six projects inthreadsworkers. All of those workers share one Node process, so the lane's largest process reached 3.8–5.0 GiB. These projects now run inforksworkers and keepisolate: false, so each worker process still reuses its module graph across files. The largest single process drops to 1.2–1.8 GiB.Stacked on #11005. That PR fixes the two tests that overflowed the main-thread stack under forks (
analysisDetail,BrowserScenarioViews). This PR depends on that fix.Problem and expected behavior
spawnSync … ENOMEMfrom that process. I did not reproduce the ENOMEM locally. The memory measurements below are executed.Expected: no single test process holds the whole source lane.
Change and scope
vitest.config.ts:domain,services,composition,conformanceandevaluationusepool: "forks". Worker counts are unchanged (4 on GitHub Actions, otherwise 2).isolate: falsestill shares each worker's module graph across files.docs/development/testing.mdstates that source projects run their shared graphs in forked workers.Not included:
mcp-boundaryremains on threads. Its peak is addressed by #10960 and the client-validation slices. No test was pruned or skipped.Contract and boundary impact
vitest.config.ts.Expected effects:
Evidence and regression coverage
The commands below were executed on macOS arm64 with Node 24.22.1 and
GITHUB_ACTIONS=true, which selects 4 workers as on CI. Each run usednode node_modules/vitest/vitest.mjs run --project domain --project services --project adapters --project composition --project conformance --project evaluation. Peak RSS was sampled every 200 ms over the process family. CPU comes fromgetrusageof the reaped children. "Cold" meansnode_modules/.vite/vitestwas removed first. The host was shared with other agents at load average 12–25 on 10 cores, so wall time is noisy and CPU time is the steadier comparison.All four runs completed 1,591 files / 30,281 tests passed (65 skipped) except the earlier threads warm run, whose result is not repeated here. The forked lane's total is about the same as the threads lane's total (≈5 GiB, within a 16 GiB hosted runner). The difference is that no single process holds the lane. Wall time and CPU are within noise: the earlier warm measurement (355 → 258 s) was not reproduced under today's load, so this PR claims memory, not speed.
For evidence-bearing changes:
Validation performed
npm run check:fastpassed.npx oxfmt --check vitest.config.ts docs/development/testing.mdpassed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.