perf(tests): enable isolate: false for unit-core workspace project#829
Merged
perf(tests): enable isolate: false for unit-core workspace project#829
Conversation
nhopeatall
approved these changes
Mar 14, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM - the change is narrowly scoped to unit-core, preserves isolation for the higher-risk unit-triggers and unit-backends projects, and matches the PR description. I verified the touched config and did not find a concrete correctness or architectural issue in the diff itself.
🕵️ codex · gpt-5.4 · run details
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
isolate: falsefor theunit-coreworkspace project invitest.config.tsisolate: true) forunit-triggersandunit-backendswhere complex mock interactions could cause inter-test pollutionWhat
isolate: falsedoesSkips per-file module re-evaluation in workers, sharing the module graph across tests in the same worker thread. This directly reduces collect-phase overhead.
Safety analysis
unit-core is safe because:
vi.mock()chains like backends/triggers)vi.useFakeTimers()callvi.useRealTimers()inafterEach/afterAll, preventing timer state leakageclearMocks: truein shared config handlesvi.fn()cleanup between testsunit-triggers and unit-backends retain default isolation because:
unit-triggers: Heavy mock interactions with config-resolver and trigger-check (~37 files)unit-backends: Complex mock setups (adapter.test.ts has 18vi.mock()calls, files that don't restore fake timers)Performance improvement
(5 consecutive runs show stable results: always 156/159 files pass — the 3 failures are pre-existing and unrelated to this change)
Test plan
unit-corehasisolate: falseinvitest.config.tsunit-triggersandunit-backendsretain default isolationafterEach/afterAllbiome check)tsc --noEmit)Closes: https://trello.com/c/gna0N4Gc/342-as-a-developer-i-want-test-isolation-disabled-for-pure-unit-test-projects-so-that-per-file-module-re-evaluation-is-skipped
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details