Skip to content

perf(tests): reuse MCP connections within source matrices - #4737

Merged
N0zoM1z0 merged 1 commit into
mainfrom
perf/tests-mcp-matrix-lifetime-20261017
Oct 17, 2026
Merged

N0zoM1z0 merged 1 commit into
mainfrom
perf/tests-mcp-matrix-lifetime-20261017

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

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.
  • Controlled negative replay: later inputs received the first actual MCP response; the new input-path assertion failed. Injection removed before the complete passing selection.
  • After runner completion, no compiled CLI/MCP processes remained in the test-owned worktree.

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.

Complete focused task Wall s Reaped CPU s Peak family GiB
Base 47.55 46.54 2.59
Change 28.90 32.18 1.17

An earlier alternating four-run prototype on a040533470 supported 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

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@N0zoM1z0
N0zoM1z0 marked this pull request as ready for review October 17, 2026 09:00
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-17T09:00:19.381845Z 37c6b59 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This test-only change appears safe to merge.

Summary

This PR reuses test-owned MCP connections in two JavaScript analysis matrices.

  • Two source-analysis test matrices reuse one MCP connection per matrix.

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

@N0zoM1z0
N0zoM1z0 merged commit 9d5b931 into main Oct 17, 2026
34 checks passed
@N0zoM1z0
N0zoM1z0 deleted the perf/tests-mcp-matrix-lifetime-20261017 branch October 17, 2026 09:11
@morluto morluto added area: tests Test suite and verification performance Performance regressions, scaling limits, and bounded-resource work labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants