fix(test): temp dir cleanup + testTimeout for parallel workers#71
Open
diazMelgarejo wants to merge 1 commit into
Open
fix(test): temp dir cleanup + testTimeout for parallel workers#71diazMelgarejo wants to merge 1 commit into
diazMelgarejo wants to merge 1 commit into
Conversation
9f6143b to
c5c67cb
Compare
…rkers
Root cause (two layers):
1. routes-browse.test.js + routes-models.test.js called mkdtempSync per test
but never cleaned up. 30+ leaked dirs/run add I/O overhead on macOS
/var/folders/ (memory-mapped filesystem).
2. db-layer parallel workers (doctor, watchdog, webhooks) leave DatabaseSync
.db-shm pages mmap'd. Under 60+ workers on ARM64, OS memory pressure slows
ALL workers — including pure-mock routes tests — past the 5s timeout.
Fix:
- routes-browse.test.js: track created dirs in createdTestRoots[]; afterEach
splices and rmSync({recursive,force}) each entry
- routes-models.test.js: same pattern for createApp() temp dirs (createdTempRoots)
- vitest.config.js: testTimeout 5000 → 10000ms; gives pure-mock workers breathing
room while db-layer .db-shm pressure fix propagates (doctor/watchdog/webhooks-db
still need afterEach closeXyzDb() — tracked as remaining upstream work)
Verified: npm run test:coverage passes 594/594 sequentially.
Target: npm test 594/594 (was 584/594 before this fix).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c5c67cb to
87c53e3
Compare
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.
While working on the main-merged old MacOS PR and testing it, we encountered these stalling files (changes from the most recent upstream fixes, especially v0.9.9 with Commit 092df06). I decided to separate this from the other commits for MacOS port.
Root cause (two layers):
Fix:
Verified: npm run test:coverage passes 594/594 sequentially.
Target: npm test 594/594 (was 584/594 before this fix).