test: reuse serial Vitest worker - #187
Merged
Merged
Conversation
📝 WalkthroughWalkthroughVitest now reuses a single isolated fork for serial process-backed tests. The upstream restart teardown test adds startup markers, waits for initialization state, reports structured restart diagnostics, and removes its temporary directory during cleanup. ChangesTest reliability
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This was referenced Jul 28, 2026
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
Root cause
fileParallelism: falseserialized 108 files but Vitest still replaced the fork worker between files. Process-backed tests therefore cold-started their real MCP Node child while the suite was also repeatedly cold-starting its outer worker. Under aggregate load this intermittently delayed an inner fixture past the existing 1s/5s integration budgets; the failure migrated between files and every exact case passed immediately in isolation.A control run with only
poolOptions.forks.singleForkkept one worker PID for the full suite and passed. The committed configuration also keepsisolate: true, so module isolation remains enabled.TDD evidence
singleForkwas absentSecurity impact
cause; they do not include environment values, tokens, credentials, or raw provider outputValidation
npm test: 1,250 passed, 24 platform-skippednpm run test:core: 404 passed, 24 platform-skippednpm run test:coverage: 1,250 passed, 24 platform-skipped; 95.39% statements, 91.85% branchesnpm run lintnpm run typechecknpm run buildnpm run smoke:clinpm run check:pack: 45 files verifiednpm run test:package: 20 passedNo timeout, skip, assertion, coverage threshold, production lifecycle behavior, or process containment was changed.
Closes #122