diff --git a/vitest.snapshot.config.ts b/vitest.snapshot.config.ts index 6a08eeb3eb..832b74929e 100644 --- a/vitest.snapshot.config.ts +++ b/vitest.snapshot.config.ts @@ -55,12 +55,16 @@ export default defineConfig({ 'packages/sdk/*/tests/**/*.snapshot.ts', 'packages/ui/tui/tests/**/*.snapshot.ts', ], - // Each test boots a subprocess; give it room and keep the worker file singular. Replay tests - // opt into bounded in-file concurrency, while record/refresh stay serial because they write - // fixtures. The environment knob restores serial replay with value 1 on constrained machines. + // Each test boots a subprocess; give it room. Replay scenarios are + // read-only (unique temp dir and fixture set per subprocess), so replay + // runs the snapshot files in parallel and bounds in-file concurrency with + // the environment knob (value 1 restores serial replay on constrained + // machines). Record and refresh stay fully serial: record spends real API + // quota per scenario, and refresh write-back harvests volatile values from + // fixtures already on disk, so concurrent writers would corrupt goldens. testTimeout: 120_000, hookTimeout: 30_000, - fileParallelism: false, + fileParallelism: (process.env.DSH_SNAPSHOT || 'replay') === 'replay', maxConcurrency: snapshotMaxConcurrency, }, })