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

🛠 Repo: Failures on main for test-node-lts: test-node:unit and test-node:integration #5278

Closed
5 tasks done
JoshuaKGoldberg opened this issue Jan 2, 2025 · 1 comment · Fixed by #5279
Closed
5 tasks done
Labels
area: repository tooling concerning ease of contribution status: accepting prs Mocha can use your help with this one!

Comments

@JoshuaKGoldberg
Copy link
Member

Tooling Suggestion Checklist

Overview

Example for test-node:unit, https://github.com/mochajs/mocha/actions/runs/12577202344/job/35054634613:

  1) ParallelBuffered
       event
         on EVENT_RUN_END
           should remove all listeners:
     TypeError: Cannot read properties of undefined (reading 'length')
      at arrayClone (node:events:894:15)
      at unwrapListeners (node:events:905:15)
      at _listeners (node:events:803:5)
      at EventEmitter.listeners (node:events:813:10)
      at Context.<anonymous> (test/node-unit/reporters/parallel-buffered.spec.js:105:23)
      at callFn (lib/runnable.js:110:584)
      at Runnable.run (lib/runnable.js:110:57)
      at Runner.runTest (lib/runner.js:182:1028)
      at /home/runner/work/mocha/mocha/lib/runner.js:210:639
      at next (lib/runner.js:159:412)
      at /home/runner/work/mocha/mocha/lib/runner.js:159:789
      at next (lib/runner.js:147:565)
      at Immediate._onImmediate (lib/runner.js:151:1226)
      at process.processImmediate (node:internal/timers:491:21)

Example for test-node:integration`, https://github.com/mochajs/mocha/actions/runs/12577202344/job/35054634364:

  1) esm
       should throw an ERR_MODULE_NOT_FOUND and not ERR_REQUIRE_ESM if file imports a non-existing module:
     
expected '\n Exception during run: Error [ERR_REQUIRE_CYCLE_MODULE]: Cannot require() ES Module /home/runner/work/mocha/mocha/test/integration/fixtures/esm/type-module/test-that-imports-non-existing-module.fixture.js in a cycle. (from /home/runner/work/mocha/mocha/lib/nodejs/esm-utils.js)\n    at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:315:15)\n    at loadESMFromCJS (node:internal/modules/cjs/loader:1414:24)\n    at Module._compile (node:internal/modules/cjs/loader:1547:5)\n    at Module.replacementCompile (/home/runner/work/mocha/mocha/node_modules/append-transform/index.js:60:13)\n    at node:internal/modules/cjs/loader:1677:16\n    at Object.<anonymous> (/home/runner/work/mocha/mocha/node_modules/append-transform/index.js:64:4)\n    at Module.load (node:internal/modules/cjs/loader:1318:32)\n    at Function._load (node:internal/modules/cjs/loader:1128:12)\n    at TracingChannel.traceSync (node:diagnostics_channel:322:14)\n    at wrapModuleLoad (node:internal/modules/cjs/loader:219:24)\n    at Module.require (node:internal/modules/cjs/loader:1340:12)\n    at require (node:internal/modules/helpers:138:16)\n    at exports.requireOrImport (/home/runner/work/mocha/mocha/lib/nodejs/esm-utils.js:10:8)\n    at async exports.loadFilesAsync (/home/runner/work/mocha/mocha/lib/nodejs/esm-utils.js:21:688)\n    at async singleRun (/home/runner/work/mocha/mocha/lib/cli/run-helpers.js:55:26)\n    at async exports.handler (/home/runner/work/mocha/mocha/lib/cli/run.js:19:452) {\n  code: \'ERR_REQUIRE_CYCLE_MODULE\'\n}\n'
to contain 'ERR_MODULE_NOT_FOUND'

Additional Info

#5165 -> 8f1c8d8 is the first commit on main that shows these complaints. It had a passing CI build and was up-to-date with the latest main. Also, the complaints are popping up in other PRs too, such as #5275. So this must be something introduced outside of our commits.

@JoshuaKGoldberg JoshuaKGoldberg added area: repository tooling concerning ease of contribution status: in triage a maintainer should (re-)triage (review) this issue labels Jan 2, 2025
@JoshuaKGoldberg
Copy link
Member Author

Major versions: this reproduces locally in Node 22 and 23 but not Node 20 or 21.

Specifically: it reproduces in Node 22.12.0 but not Node 22.11.0. Node v22.12.0 was released on December 3rd and is the current latest LTS.

I took a quick search through the Node issue tracker and found nodejs/node#56263. Same error stack, same introduced version. And a fix commit already landed in nodejs/node@acda05d. Swell.

Pending the next Node LTS version being released with a fix, I'll try keeping us in CI to 22.11.0...

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Mocha can use your help with this one! and removed status: in triage a maintainer should (re-)triage (review) this issue labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: repository tooling concerning ease of contribution status: accepting prs Mocha can use your help with this one!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant