Repository navigation
perf(tests): reuse MCP connections within source matrices - #4737
Conversation
Codex Review SummaryThis 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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] This test-only change appears safe to merge. SummaryThis PR reuses test-owned MCP connections in two JavaScript analysis matrices.
No actionable issues were found. Tests were not rerun during this review. Whether another PR supersedes this one could not be checked because GitHub access was unavailable. Reviews (1) · Last reviewed commit: "perf(tests): reuse MCP connections withi..." · Reviewed by Greptile |
Summary
Reuse one test-owned stdio MCP connection within each of two stateless JavaScript source-analysis matrices. The early-return matrix previously started four servers and retained them until test completion; the adjacent spread/control comparison started two. All original scenarios, fresh compiled CLI calls, schema validation, Evidence/coverage assertions and test-finished cleanup remain. New input-path and content-identity checks reject cross-input result replay.
The helper accepts an optional typed caller; existing consumers retain their default connection behavior. This is a two-file test optimization with no runtime/API/provider authority change. No separate issue is linked for this measured test-cost improvement; the independent worker OOM diagnosis remains tracked in #4713.
Validation performed
npm run test:focused -- tests/boundary/cli/electronWrappedCallPaths.test.ts tests/acceptance/applications/emptyImportNameCli.test.ts tests/acceptance/applications/packageSubpathsCli.test.ts— 23/23 passed, including the entire 19-case boundary file and default CLI/MCP consumers.npm run check:ci— passed, including typecheck, lint, formatting, Knip, module boundaries and architecture guards.Performance evidence
Pinned latest-main base:
e09a503f44fba1639b71907a018d71161360f5ae. One completed before/after pair uses the same four CLI plus four stdio MCP scenarios; the optimized version also checks input identity.An earlier alternating four-run prototype on
a040533470supported the same direction (median 40.21→26.45 s wall; 47.48→31.19 s CPU; 2.53→1.18 GiB). Those measurements remain attributed to that older revision.Linux x64, pinned Node24.18.0/npm11.16.0/Vitest5.0.3; serial local heavy jobs, two cores, 3 GiB default Node heap and the existing 384 MiB boundary worker limit. Process-fresh trials use uncontrolled OS/dependency caches; no machine-cold, full-CI speedup or model-token reduction is claimed. RSS is sampled at 200 ms, may double-count shared pages/miss short processes and excludes assistant/shared services; CPU covers reaped descendants. Complete static checks peaked at 4.90 GiB, without an OOM or resource stop.
These are actual compiled CLI/stdio MCP workflows over test-owned static sources. Electron execution and native provider behavior are unverified. No test, deadline, worker bound or coverage gate was removed or relaxed. No directly related cleanup remains in these two matrices.
Author readiness
Human owner: @N0zoM1z0