fix: resolve flaky cleanup test race condition in CI

The subdirectory removal test used setImmediate ticks to wait for async
cleanup, which was insufficient on slow CI runners. Replaced with real
setTimeout delays (100 x 10ms) to give async readdir/stat/rm I/O time
to complete.
This commit is contained in:
SnapOtter
2026-05-09 13:12:11 +08:00
parent 1fa45f3272
commit 9f97c466b3
+2 -2
View File
@@ -34,8 +34,8 @@ function removeSetting(key: string) {
}
async function waitForCleanup(): Promise<void> {
for (let i = 0; i < 50; i++) {
await new Promise((resolve) => setImmediate(resolve));
for (let i = 0; i < 100; i++) {
await new Promise((resolve) => setTimeout(resolve, 10));
}
}