From a92136cd69b4ccd0c1048af9cc68470a49326254 Mon Sep 17 00:00:00 2001 From: "shumeiko.it" Date: Mon, 2 Nov 2026 17:13:17 +0100 Subject: [PATCH] fix(scripts): do not fail the desktop smoke test on temp cleanup A writer of the stopped app can still be finishing in the data directory when the smoke test removes its temp root, so rmdir failed with ENOTEMPTY after the test had passed. The temp root is disposable: a failed cleanup now logs a warning. --- scripts/release-smoke.mjs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/release-smoke.mjs b/scripts/release-smoke.mjs index b2c5fdd..8eeea5f 100644 --- a/scripts/release-smoke.mjs +++ b/scripts/release-smoke.mjs @@ -71,8 +71,17 @@ function tempRoot(name) { return fs.mkdtempSync(path.join(process.env.RUNNER_TEMP || os.tmpdir(), `waggle-smoke-${name}-`)); } +/** + * Best effort: a background writer of the stopped app (a model download into + * the data directory) can outlive the stop by a moment. The temp root is + * disposable, so a failed cleanup is a warning, not a failed smoke test. + */ function removeTree(dir) { - fs.rmSync(dir, { recursive: true, force: true, maxRetries: 5, retryDelay: 1000 }); + try { + fs.rmSync(dir, { recursive: true, force: true, maxRetries: 10, retryDelay: 1000 }); + } catch (error) { + log(`Warning: could not remove ${dir}: ${error instanceof Error ? error.message : String(error)}`); + } } function portIsFree(port) {