From 9a497802eadd201734d3018e9116f70c302fabc5 Mon Sep 17 00:00:00 2001 From: ranxianglei Date: Wed, 21 Oct 2026 10:57:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20close=20store1=20before=20dropping?= =?UTF-8?q?=20index.db=20in=20#3769=20pooled-bare-load=20=E2=80=94=20Windo?= =?UTF-8?q?ws=20EBUSY?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cold-restore simulation rmSync's index.db while store1's sqlite handle is still open; Windows refuses the unlink with EBUSY, failing the test on every windows shard (the half of the #4076 red that the #4077 pin could not fix). Close store1 first, same discipline as the plugin-fork cold restores; the finally block's closeQuietly() pass tolerates the double close. --- tests/issue3769-pooled-bare-load.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 }); }