diff --git a/tests/issue3769-pooled-bare-load.test.ts b/tests/issue3769-pooled-bare-load.test.ts index f5a3dd8125..42f5a1d5b4 100644 --- a/tests/issue3769-pooled-bare-load.test.ts +++ b/tests/issue3769-pooled-bare-load.test.ts @@ -104,7 +104,10 @@ test("bare-id loadSync hydrates a pooled envelope when the unified index misses assert.equal(pooled.filter((f) => f.endsWith(".json") && !f.endsWith(".content-store.json")).length, 1, "pooled envelope present"); // Simulate the index miss: drop index.db entirely (plus sqlite - // sidecars) while the envelope stays on disk. + // sidecars) while the envelope stays on disk. Close store1 FIRST: + // Windows refuses to unlink a file its sqlite handle still holds + // (EBUSY) — same discipline as the plugin-fork cold restores. + store1.closeQuietly(); for (const side of ["index.db", "index.db-wal", "index.db-shm"]) { rmSync(path.join(dir, side), { force: true }); }