Skip to content

Commit 182c2a8

Browse files
committed
test(nostr): reset the plugin state store before removing fixture state dirs
The doctor migration fixture and the temporary-state-dir helper both open the plugin state store under the fixture's directory and reset it only during setup, so Windows fails the removal with EBUSY while Linux unlinks the open files and stays green. Reset the store immediately before each removal, matching the ordering the fixtures repaired in #126352 already use.
1 parent 3ae7ba3 commit 182c2a8

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎extensions/nostr/doctor-contract-api.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe("nostr doctor state migration", () => {
4040
});
4141

4242
afterEach(async () => {
43+
resetPluginStateStoreForTests();
4344
await fs.rm(stateDir, { recursive: true, force: true });
4445
});
4546

‎extensions/nostr/src/nostr-state-store.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ async function withTempStateDir<T>(fn: (dir: string) => Promise<T>) {
4949
} else {
5050
process.env.OPENCLAW_STATE_DIR = previous;
5151
}
52+
// The keyed store keeps the state database open under the temporary dir, so Windows
53+
// fails the removal with EBUSY unless the cached handle is released first.
54+
resetPluginStateStoreForTests();
5255
await fs.rm(dir, { recursive: true, force: true });
5356
}
5457
}

0 commit comments

Comments
 (0)