PEP-144: test teardown retries removing its temp dir — ENOTEMPTY on a busy CI runner failed a whole test file

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Асель 2026-11-16 12:06:07 +05:00
parent d0c3293246
commit 33fa9a743c

View File

@ -46,7 +46,9 @@ export async function teardown() {
} catch {}
// Every run left its temp dir behind (~1 GB after a few hundred runs filled the disk);
// PEPPA_KEEP_TEST_TMP=1 keeps it for debugging.
if (!process.env.PEPPA_KEEP_TEST_TMP) rmSync(TMP, { recursive: true, force: true });
// Processes of the tmux server just killed may still write a file for a moment (ENOTEMPTY on a
// busy CI runner, PEP-144) — retry instead of failing the whole test file.
if (!process.env.PEPPA_KEEP_TEST_TMP) rmSync(TMP, { recursive: true, force: true, maxRetries: 10, retryDelay: 200 });
}
export async function waitFor<T>(label: string, fn: () => Promise<T | null | undefined | false>, timeoutMs = 25000): Promise<T> {