Skip to content

Commit dc2485e

Browse files
authored
Pinned vitest pool to forks in createVitestConfig (#27691)
no ref This is a small adjustment for (what is currently) the posts, stats, and admin-x-settings. We've observed some occasional flakiness that seems to be from crossing boundaries, and moving to forks is going to be a slight perf hit but given this is what are otherwise-speedy unit tests with a limited app scope, it seems fine for now. Switch the shared `createVitestConfig` from Vitest's default `threads` pool to `forks`. Forks runs each worker as a separate child process, giving stronger isolation than threads (which run in separate V8 isolates but still share the Node process — and therefore process-scoped state).
1 parent d128c64 commit dc2485e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

apps/admin-x-framework/src/test/vitest-config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export function createVitestConfig(options: VitestConfigOptions = {}) {
4242
test: {
4343
globals: true,
4444
environment: 'jsdom',
45+
// pool: 'forks' for process-level isolation in jsdom-heavy
46+
// React suites; sidesteps Vitest threads-pool edge cases.
47+
pool: 'forks',
48+
isolate: true,
4549
setupFiles,
4650
include,
4751
silent,

0 commit comments

Comments
 (0)