From 798da979a19a74c5a4ef15313f61640c29e51c71 Mon Sep 17 00:00:00 2001 From: arookieofc <2128194521@qq.com> Date: Fri, 6 Nov 2026 22:10:30 +0800 Subject: [PATCH] test(smoke): retry the temp-directory cleanup on ENOTEMPTY (#1838) Language servers and debug adapters still write into the fixture's temp dir as the test's afterEach tears it down, so a bare rmSync raced them and failed the suite on ENOTEMPTY (Language smoke kotlin, java). Give the removal maxRetries + retryDelay so a few late writes can't flake the job. --- smoke/debug.test.ts | 2 +- smoke/run.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/smoke/debug.test.ts b/smoke/debug.test.ts index 1e336b0e6..84348d8f6 100644 --- a/smoke/debug.test.ts +++ b/smoke/debug.test.ts @@ -109,7 +109,7 @@ afterEach(() => { resetRuns(); disconnect?.(); server?.close(); - if (base) rmSync(base, { recursive: true, force: true }); + if (base) rmSync(base, { recursive: true, force: true, maxRetries: 5, retryDelay: 200 }); }); async function open(c: Case): Promise { diff --git a/smoke/run.test.ts b/smoke/run.test.ts index bda7b31f4..d9b6c7274 100644 --- a/smoke/run.test.ts +++ b/smoke/run.test.ts @@ -133,7 +133,7 @@ afterEach(() => { resetRuns(); disconnect?.(); server?.close(); - if (base) rmSync(base, { recursive: true, force: true }); + if (base) rmSync(base, { recursive: true, force: true, maxRetries: 5, retryDelay: 200 }); }); async function open(c: Case): Promise {