fix(FN-5168): harden db temp-dir cleanup

Fusion-Task-Id: FN-5168
Fusion-Task-Lineage: 0c865d3e-0886-4e51-a7ff-cb4c713dcc54
This commit is contained in:
Fusion (runfusion.ai)
2026-05-19 16:14:26 -07:00
committed by gsxdsm
parent dac2ebbbf3
commit 95707dc98f

View File

@@ -69,6 +69,11 @@ function cleanupTmpDirsSync(): void {
}
}
// Full-suite worker shutdown can skip Vitest's normal afterAll timing if the worker
// is already draining, so keep a process-level sync cleanup backstop for kb-db-test-*.
process.once("beforeExit", cleanupTmpDirsSync);
process.once("exit", cleanupTmpDirsSync);
afterAll(() => {
cleanupTmpDirsSync();
});