test(server): await bounded discard fixture cleanup on Windows

The discard assertions pass but synchronous temporary-directory removal races a Windows lock after daemon cleanup. Use the existing asynchronous rm retry pattern without weakening the behavior assertions.
This commit is contained in:
paseo-bot[bot]
2026-10-14 20:41:00 +02:00
parent 427d6e066b
commit f1ebe47959
@@ -8,6 +8,7 @@ import {
readdirSync,
readlinkSync,
} from "fs";
import { rm } from "node:fs/promises";
import { tmpdir } from "os";
import path from "path";
import { execFileSync } from "node:child_process";
@@ -100,7 +101,9 @@ describe("checkout discard", () => {
}
} finally {
// afterEach shuts down the daemon and its repository observers first.
onTestFinished(() => rmSync(cwd, { recursive: true, force: true }));
onTestFinished(() =>
rm(cwd, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 }),
);
}
},
);