chore: ensures more stable CI runs on Windows environments. (#3070)

This pull request includes a small but important change to the
`withTmpDir` function in `src/test_utils.ts`. The change adds error
handling to ensure that a `PermissionDenied` error during directory
removal does not interrupt the execution.
This commit is contained in:
zhizheng
2025-07-10 10:09:16 +02:00
committed by GitHub
parent 31434a2cf9
commit cfc9a9a601
+7 -1
View File
@@ -125,7 +125,13 @@ export async function withTmpDir(
return {
dir,
async [Symbol.asyncDispose]() {
await Deno.remove(dir, { recursive: true });
try {
await Deno.remove(dir, { recursive: true });
} catch (error) {
if (!(error instanceof Deno.errors.PermissionDenied)) {
throw error;
}
}
},
};
}