perf: speed plugin contract tests and fix ci

This commit is contained in:
Peter Steinberger
2026-04-29 05:17:23 +01:00
parent 9ae629052a
commit 203213028e
6 changed files with 49 additions and 8 deletions

View File

@@ -26,7 +26,17 @@ function readOptionalUtf8(filePath) {
}
function removePathIfExists(targetPath) {
fs.rmSync(targetPath, { recursive: true, force: true });
for (let attempt = 0; ; attempt += 1) {
try {
fs.rmSync(targetPath, { recursive: true, force: true });
return;
} catch (error) {
if (!isTransientTempRemoveError(error) || attempt >= TEMP_REMOVE_RETRY_DELAYS_MS.length) {
throw error;
}
sleepSync(TEMP_REMOVE_RETRY_DELAYS_MS[attempt]);
}
}
}
function isTransientTempRemoveError(error) {