diff --git a/packages/testkit/test/helpers.ts b/packages/testkit/test/helpers.ts index d8431cfa..ca57c2c0 100644 --- a/packages/testkit/test/helpers.ts +++ b/packages/testkit/test/helpers.ts @@ -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(label: string, fn: () => Promise, timeoutMs = 25000): Promise {