test: isolate fixture state by copying per getFixture() call#26
Draft
aminevg wants to merge 1 commit into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Each getFixture() call now copies the source fixture to a unique fixtures/.tmp/<id>/ directory. The copy becomes the fixtureRoot, so outDir, .astro, node_modules/.vite, and the CLI's default dist/ all land inside that unique dir — nothing is ever shared between tests. clean() becomes a no-op, which removes the rm-during-vite-shutdown race entirely: the vite optimizer (esbuild) keeps writing async to node_modules/.vite after viteServer.close() returns, so the previous rm() in afterEach could race with it. With per-test directories there is no longer any need to clean up between tests; a globalSetup hook wipes fixtures/.tmp/ once before each test run instead. Drops the workarounds from the previous PR: - maxRetries/retryDelay on the rm() calls - fileParallelism: false in the root vitest config Test parallelism is re-enabled (~33s → ~20s for the full suite).
d102a8c to
00c20dc
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.
Summary
Stacked on #25. Each
getFixture()call now copies the source fixture to a uniquefixtures/.tmp/<id>/directory. The copy becomesfixtureRoot, sooutDir,.astro,node_modules/.vite, and the CLI's defaultdist/all land inside that unique dir — nothing is ever shared between tests.clean()becomes a no-op, which removes the rm-during-vite-shutdown race entirely (the optimizer keeps writing async tonode_modules/.viteafterviteServer.close()returns). AglobalSetuphook wipesfixtures/.tmp/once before each test run.Drops the workarounds introduced in #25:
maxRetries/retryDelayon therm()calls in both fixture helpersfileParallelism: falsein the root vitest configSuite drops from ~33s (serial) to ~20s (parallel) with parallelism re-enabled.
Test plan
pnpm buildpnpm run typecheckpnpm run ci:biomepnpm test— 5/5 consecutive runs green at full parallelism (verified locally)