From 33fa9a743c11f1ed13a2154e078b339932721651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=81=D0=B5=D0=BB=D1=8C?= Date: Mon, 16 Nov 2026 12:06:07 +0500 Subject: [PATCH] =?UTF-8?q?PEP-144:=20test=20teardown=20retries=20removing?= =?UTF-8?q?=20its=20temp=20dir=20=E2=80=94=20ENOTEMPTY=20on=20a=20busy=20C?= =?UTF-8?q?I=20runner=20failed=20a=20whole=20test=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.2 --- packages/testkit/test/helpers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 {