fix(server): harden test cleanup and deadlines for Windows runners (#88)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Yaowei Zheng
2026-07-27 23:16:20 +08:00
committed by GitHub
parent f192db338e
commit 033d526f9f
2 changed files with 24 additions and 1 deletions
+5 -1
View File
@@ -66,7 +66,11 @@ export async function createTestApp(options: TestAppOptions = {}): Promise<TestA
cleanup: async () => {
deps.channels.dispose();
deps.db.close();
await fs.rm(root, { recursive: true, force: true });
// maxRetries: Windows can report ENOTEMPTY/EBUSY while handles from the test's own
// just-closed files (SQLite, trace writers) are still being released — Node's rm
// retries these codes with a delay. A plain rm was the top cause of ci-windows
// cascades (cleanup throws → hook timeout → "database is not open" in later files).
await fs.rm(root, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });
},
};
}