From 449a1a22430a15c934e0586ea2734614b2c40a06 Mon Sep 17 00:00:00 2001 From: BOHA Date: Sat, 6 Jun 2026 14:01:28 +0200 Subject: [PATCH] test: serialise test files (fileParallelism:false) to avoid shared-DB deadlock The numbering and manual-create suites both lock the number_sequences 'shared' row (SELECT ... FOR UPDATE + deleteMany); running test files in parallel raced them into a MySQL 1213 deadlock. Production never does that concurrent delete, so this is purely a parallel-test isolation fix. Co-Authored-By: Claude Opus 4.8 (1M context) --- vitest.config.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vitest.config.ts b/vitest.config.ts index 57734df..ad0b36b 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -10,5 +10,11 @@ export default defineConfig({ testTimeout: 15000, hookTimeout: 15000, exclude: ["dist/**", "node_modules/**", ".claude/**"], + // Tests run against a real shared MySQL test DB. Running test files in + // parallel lets two files (e.g. numbering + manual-create) hit the same + // `number_sequences` row with SELECT ... FOR UPDATE + deleteMany at once, + // which deadlocks (MySQL 1213). Serialise files so DB-touching suites + // don't contend. Tests within a file already run sequentially. + fileParallelism: false, }, });