mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix(tests): prevent SQLITE_BUSY race by running tests in a single fork
vitest was spawning multiple worker processes (one per test file) that each independently opened the same SQLite database and raced to set journal_mode = WAL. Adding pool: "forks" with singleFork: true runs all test files in the same child process, eliminating the concurrent-open race. The test suite (~830 tests) remains fast enough for CI.
This commit is contained in:
@@ -14,6 +14,14 @@ export default defineConfig({
|
||||
globals: true,
|
||||
testTimeout: 30_000,
|
||||
hookTimeout: 30_000,
|
||||
// Run all test files in a single forked process so integration tests share
|
||||
// the same SQLite connection and avoid SQLITE_BUSY races on WAL setup.
|
||||
pool: "forks",
|
||||
poolOptions: {
|
||||
forks: {
|
||||
singleFork: true,
|
||||
},
|
||||
},
|
||||
exclude: [
|
||||
"tests/e2e/**",
|
||||
"**/node_modules/**",
|
||||
|
||||
Reference in New Issue
Block a user