fix(tasks): close registry stores on test resets

This commit is contained in:
Vincent Koc
2026-04-02 21:38:35 +09:00
parent 6f91f87f3b
commit d4f69878da
2 changed files with 4 additions and 4 deletions

View File

@@ -710,6 +710,6 @@ export function resetTaskFlowRegistryForTests(opts?: { persist?: boolean }) {
resetTaskFlowRegistryRuntimeForTests();
if (opts?.persist !== false) {
persistFlowRegistry();
getTaskFlowRegistryStore().close?.();
}
getTaskFlowRegistryStore().close?.();
}

View File

@@ -1927,10 +1927,10 @@ export function resetTaskRegistryForTests(opts?: { persist?: boolean }) {
listenerStarted = false;
if (opts?.persist !== false) {
persistTaskRegistry();
// Close the sqlite handle after persisting the empty snapshot so Windows temp-dir
// cleanup can remove the state directory without hitting runs.sqlite EBUSY errors.
getTaskRegistryStore().close?.();
}
// Always close the sqlite handle so Windows temp-dir cleanup can remove the
// state directory even when a test intentionally skips persisting the reset.
getTaskRegistryStore().close?.();
}
export function resetTaskRegistryDeliveryRuntimeForTests() {