Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci vitest fails "handle integrity checks" on Windows Node.js 23 #597

Open
MikeMcC399 opened this issue Jan 14, 2025 · 3 comments
Open

ci vitest fails "handle integrity checks" on Windows Node.js 23 #597

MikeMcC399 opened this issue Jan 14, 2025 · 3 comments

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Jan 14, 2025

Issue

When running corepack yarn test on Windows with Node.js 23.x the test fails with:

FAIL tests/main.test.ts > handle integrity checks > should return an error when signature does not match with a tag

The issue does not occur on Windows with Node.js 18, 20 or 22, for example Node.js 22.13.0 LTS.

This is a problem preventing CI updating to testing on Node.js 23. At this time it is not identified as an end-user issue.

Steps to reproduce

Windows 11 24H2
Node.js v23.0.0 or v23.6.0
Use Drive C: for clone

It is also reproducible in GitHub runners windows-2022 and windows-2025

git clone https://github.com/nodejs/corepack
cd corepack
corepack yarn add [email protected] -D # until PR #594 is merged
corepack yarn build
corepack yarn run vitest --run

or to only run the test section which fails:

corepack yarn run vitest -t "handle integrity checks" --run

Logs

$ corepack yarn add [email protected] -D # until PR #594 is merged
➤ YN0000: · Yarn 4.3.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0s 277ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 424 packages were added to the project (+ 132.08 MiB).
➤ YN0000: └ Completed in 21s 597ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ better-sqlite3@npm:11.7.2 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.21.5 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 13s 9ms
➤ YN0000: · Done with warnings in 34s 979ms
$ corepack yarn build

  dist\lib\corepack.cjs  925.6kb

⚡ Done in 619ms
All shims have been generated.
$ corepack yarn run vitest --run

 RUN  v2.0.3 C:/Users/mikem/github/corepack

 ✓ tests/config.test.ts (1)
 ✓ tests/corepackUtils.test.ts (4)
 ✓ tests/Disable.test.ts (3) 735ms
 ✓ tests/Enable.test.ts (3) 742ms
 ❯ tests/main.test.ts (81) 264191ms
   ✓ should refuse to download a package manager if the hash doesn't match 748ms
   ✓ should refuse to download a known package manager from a URL 1106ms
   ✓ should refuse to download a known package manager from a URL in package.json (retry x2) 1295ms
   ✓ should require a version to be specified 654ms
   ✓ should use the right package manager version for a given project ([email protected]) 1571ms
   ✓ should use the right package manager version for a given project ([email protected]+sha1.01c1197ca5b27f21edc8bc472cd4c8ce0e5a470e) 1305ms
   ✓ should use the right package manager version for a given project ([email protected]+sha224.0d6eecaf4d82ec12566fdd97143794d0f0c317e0d652bd4d1b305430) 1314ms
   ✓ should use the right package manager version for a given project (yarn@https://registry.npmjs.com/yarn/-/yarn-1.22.21.tgz) 1327ms
   ✓ should use the right package manager version for a given project (yarn@https://registry.npmjs.com/yarn/-/yarn-1.22.21.tgz#sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72) 1313ms
   ✓ should use the right package manager version for a given project ([email protected]) 1488ms
   ✓ should use the right package manager version for a given project ([email protected]+sha1.4f0423b01bcb57f8e390b4e0f1990831f92dd1da) 1259ms
   ✓ should use the right package manager version for a given project ([email protected]+sha224.0e7a64468c358596db21c401ffeb11b6534fce7367afd3ae640eadf1) 1258ms
   ✓ should use the right package manager version for a given project ([email protected]) 1447ms
   ✓ should use the right package manager version for a given project ([email protected]+sha1.694bdad81703169e203febd57f9dc97d3be867bd) 1207ms
   ✓ should use the right package manager version for a given project ([email protected]+sha224.f83f6d1cbfac10ba6b516a62ccd2a72ccd857aa6c514d1cd7185ec60) 1178ms
   ✓ should use the right package manager version for a given project ([email protected]) 12628ms
   ✓ should use the right package manager version for a given project ([email protected]+sha1.7cffc04295f4db4740225c6c37cc345eb923c06a) 12751ms
   ✓ should use the right package manager version for a given project ([email protected]+sha224.7783c4b01916b7a69e6ff05d328df6f83cb7f127e9c96be88739386d) 12453ms
   ✓ should use the right package manager version for a given project ([email protected]) 1934ms
   ✓ should use the right package manager version for a given project ([email protected]+sha1.7b4d6b176c1b93b5670ed94c24babb7d80c13854) 1578ms
   ✓ should use the right package manager version for a given project ([email protected]+sha224.eb5c0acad3b0f40ecdaa2db9aa5a73134ad256e17e22d1419a2ab073) 1652ms
   ✓ should use the right package manager version for a given project ([email protected]) 9396ms
   ✓ should use the right package manager version for a given project ([email protected]+sha1.f057d35cd4792c4c511bb1fa332edb43143d07b0) 8318ms
   ✓ should use the right package manager version for a given project ([email protected]+sha224.50512c1eb404900ee78586faa6d756b8d867ff46a328e6fb4cdf3a87) 8191ms
   ✓ should update the Known Good Release only when the major matches 2523ms
   ✓ should ignore the packageManager field when found within a node_modules vendor 1746ms
   ✓ should use the closest matching packageManager field 7660ms
   ✓ should expose its root to spawned processes 7854ms
   ✓ shouldn't allow using regular Yarn commands on npm-configured projects
   ✓ should allow using transparent commands on npm-configured projects 990ms
   ✓ should transparently use the preconfigured version when there is no local project 1031ms
   ✓ should use the pinned version when local projects don't list any spec (npm) 3872ms
   ✓ should use the pinned version when local projects don't list any spec (pnpm) 2044ms
   ✓ should use the pinned version when local projects don't list any spec (yarn) 952ms
   ✓ should configure the project when calling a package manager on it for the first time 998ms
   ✓ should allow updating the pinned version using the "corepack install -g" command 1679ms
   ✓ should allow to call "corepack install -g" with a tag 5635ms
   ✓ should allow to call "corepack install -g" without any range 1919ms
   ✓ should allow to call "corepack install" without arguments within a configured project 1371ms
   ✓ should refuse to run a different package manager within a configured project 3243ms
   ✓ should always use fallback version when project spec env is disabled 3172ms
   ✓ should support disabling the network accesses from the environment
   ✓ read-only and offline environment (2) 3194ms
   ✓ should support hydrating package managers from cached archives 1442ms
   ✓ should support hydrating package managers if cache folder was removed 1364ms
   ✓ should support hydrating multiple package managers from cached archives 29821ms
   ✓ should support running package managers with bin array 1234ms
   ✓ should handle parallel installs 2438ms
   ✓ should not override the package manager exit code
   ✓ should not preserve the process.exitCode when a package manager throws
   ✓ should not set the exit code after successfully launching the package manager
   ✓ should support package managers in ESM format
   ✓ should show a warning on stderr before downloading when enable 933ms
   ✓ should be able to show the latest version 2209ms
   ✓ should download yarn classic from custom registry 1793ms
   ✓ should download yarn berry from custom registry 2563ms
   ✓ should download latest pnpm from custom registry 3522ms
   ✓ custom registry with auth COREPACK_NPM_REGISTRY (4) 12950ms
   ✓ custom registry with auth COREPACK_NPM_TOKEN (4) 12963ms
   ✓ custom registry with auth COREPACK_NPM_PASSWORD (4) 12981ms
   ✓ custom registry with auth PROXY (4) 13148ms
   ❯ handle integrity checks (7) 26169ms
     ✓ should return no error when signature matches 6504ms
     × should return an error when signature does not match with a tag (retry x2) 1451ms
     ✓ should return an error when hash does not match without a tag 3942ms
     ✓ should return an error when signature does not match without a tag 3860ms
     ✓ should return an error when signature does not match when version is provided 3470ms
     ✓ should return an error when hash does not match 3476ms
     ✓ should return no error when signature does not match when hash is provided 3466ms
 ✓ tests/npmRegistryUtils.test.ts (7)
 ✓ tests/Up.test.ts (1) 2018ms
 ✓ tests/Use.test.ts (2) 5000ms

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  tests/main.test.ts > handle integrity checks > should return an error when signature does not match with a tag
 FAIL  tests/main.test.ts > handle integrity checks > should return an error when signature does not match with a tag
 FAIL  tests/main.test.ts > handle integrity checks > should return an error when signature does not match with a tag
AssertionError: expected { exitCode: 3221226505, …(2) } to match object { exitCode: 1, …(2) }

- Expected
+ Received

  Object {
-   "exitCode": 1,
-   "stderr": /Signature does not match/,
+   "exitCode": 3221226505,
+   "stderr": "C:\\Users\\mikem\\github\\corepack\\dist\\lib\\corepack.cjs:21546
+     throw new Error(`Signature does not match`);
+           ^
+
+ Error: Signature does not match
+     at verifySignature (C:\\Users\\mikem\\github\\corepack\\dist\\lib\\corepack.cjs:21546:11)
+     at installVersion (C:\\Users\\mikem\\github\\corepack\\dist\\lib\\corepack.cjs:21882:7)
+     at async Engine.ensurePackageManager (C:\\Users\\mikem\\github\\corepack\\dist\\lib\\corepack.cjs:22316:32)
+     at async Engine.executePackageManagerRequest (C:\\Users\\mikem\\github\\corepack\\dist\\lib\\corepack.cjs:22416:25)
+     at async Object.runMain (C:\\Users\\mikem\\github\\corepack\\dist\\lib\\corepack.cjs:23102:5)
+
+ Node.js v23.6.0
+ Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file c:\\ws\\deps\\uv\\src\\win\\async.c, line 76
+ ",
    "stdout": "",
  }

 ❯ tests/main.test.ts:1024:7
    1022|
    1023|     await xfs.mktempPromise(async cwd => {
    1024|       await expect(runCli(cwd, [`[email protected]`, `--version`], true)).resolves.toMatchObject({
       |       ^
    1025|         exitCode: 1,
    1026|         stderr: /Signature does not match/,
 ❯ NodeFS.mktempPromise ../../AppData/Local/Yarn/Berry/cache/@yarnpkg-fslib-npm-3.1.0-821f4faf89-10c0.zip/node_modules/@yarnpkg/fslib/lib/xfs.js:86:24
 ❯ tests/main.test.ts:1023:5

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯

 Test Files  1 failed | 7 passed (8)
      Tests  1 failed | 101 passed (102)
   Start at  17:14:55
   Duration  265.00s (transform 440ms, setup 212ms, collect 1.58s, tests 272.96s, environment 2ms, prepare 1.55s)
@aduh95
Copy link
Contributor

aduh95 commented Jan 14, 2025

The assertion is set here: https://github.com/libuv/libuv/blob/be8eec8c5a99bcce5a1b8435237dad588cfd9f28/src/win/async.c#L76

We could try updating the other dev dependencies (in particular, the Yarn fslib that's listed in the error message). If that doesn't help, it might be worth opening as an issue on the libuv repo as it could be an upstream bug.

@MikeMcC399
Copy link
Contributor Author

@aduh95

We could try updating the other dev dependencies (in particular, the Yarn fslib that's listed in the error message). If that doesn't help, it might be worth opening as an issue on the libuv repo as it could be an upstream bug.

Thank you for looking at this. I did try updating dependencies i.e.

corepack yarn add better-sqlite3@latest -D
corepack yarn up
corepack yarn build
corepack yarn test

however that still failed in the same way on Windows 11 with Node.js 23.6.0.

As you say, it could be an upstream issue.

I don't have the skills and experience to solve this. I also wouldn't be the right person to open an issue on libuv without having the necessary level of understanding.

@aduh95
Copy link
Contributor

aduh95 commented Jan 17, 2025

I've opened nodejs/node#56645

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants