From 9c6c918890d54df3b323c0e712d862ffa0fe9feb Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Wed, 17 Dec 2025 11:17:44 -0800 Subject: [PATCH] more resilient tests --- scripts/utils.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/utils.ts b/scripts/utils.ts index c494c8ece..6c2223c65 100644 --- a/scripts/utils.ts +++ b/scripts/utils.ts @@ -40,7 +40,16 @@ export const withGeneratorLock = async (fn: () => Promise) => { try { return await fn(); } finally { - fs.unlinkSync(lockFilePath); + try { + fs.unlinkSync(lockFilePath); + } catch (e) { + if ("code" in e && e.code === "ENOENT") { + // Someone else already deleted the lock file, not sure why but let's keep going + console.warn(`Generator lock file ${lockFilePath} already deleted by someone else, not sure why but let's keep going. You may want to investigate this.`); + return; + } + throw e; + } } }