From c5e68186b69f84ca1ae31093769ad8d160d0db10 Mon Sep 17 00:00:00 2001 From: Qingyu Wang <40660121+colinaaa@users.noreply.github.com> Date: Sun, 29 Mar 2026 16:19:05 +0800 Subject: [PATCH] fix: flaky tests due to corepack concurrency on Windows --- src/createTarball.ts | 7 ++++++- test/npm/package.json | 2 +- test/pnpm-workspace/package.json | 2 +- test/pnpm/package.json | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/createTarball.ts b/src/createTarball.ts index 934b3a4..418d6f7 100644 --- a/src/createTarball.ts +++ b/src/createTarball.ts @@ -43,12 +43,17 @@ export async function createTarball( nodeOptions: { cwd: root, }, + throwOnError: true, }); return { path: tarballPath, async [Symbol.asyncDispose]() { - return fs.unlink(tarballPath); + try { + await fs.unlink(tarballPath); + } catch { + // ignore unlink errors to avoid masking original errors + } }, }; } diff --git a/test/npm/package.json b/test/npm/package.json index a540bf4..93911e0 100644 --- a/test/npm/package.json +++ b/test/npm/package.json @@ -6,5 +6,5 @@ "files": [ "src/*" ], - "packageManager": "npm@10.9.3" + "packageManager": "npm@10.9.8+sha512.7d8c1be8e0d298792aac9410682c58dccda53dffe6a600bb8a4d074b3cc8c06e421ad69b469e1b36a8a46adbc2a13e366f920d412aae7551f447bc95982f6156" } diff --git a/test/pnpm-workspace/package.json b/test/pnpm-workspace/package.json index 7ccbba7..a0389dc 100644 --- a/test/pnpm-workspace/package.json +++ b/test/pnpm-workspace/package.json @@ -6,5 +6,5 @@ "files": [ "src/*" ], - "packageManager": "pnpm@10.14.0" + "packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319" } diff --git a/test/pnpm/package.json b/test/pnpm/package.json index 7ccbba7..a0389dc 100644 --- a/test/pnpm/package.json +++ b/test/pnpm/package.json @@ -6,5 +6,5 @@ "files": [ "src/*" ], - "packageManager": "pnpm@10.14.0" + "packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319" }