-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Developer Tools
cli-repl-gc.spec.ts intermittently fails in CI, asserting a tagged object is still present in the heap snapshot after cliRepl.close(). The test already works around a known Node.js issue https://github.com/nodejs/node/pull/61895 with a hardcoded 100ms delay after close before taking the heap snapshot, but Node's REPL 'exit' listener chain is async and not awaited by whoever emits 'exit', so a fixed delay doesn't work reliably.
[2026/07/22 10:07:24.765] 1) CliRepl GC
[2026/07/22 10:07:24.765] objects from inside a REPL can be garbage collected:
[2026/07/22 10:07:24.765] AssertionError: expected [ { type: 'object', …(5) } ] to have a length of +0 but got 1
[2026/07/22 10:07:24.765] + expected - actual
[2026/07/22 10:07:24.765] -1
[2026/07/22 10:07:24.765] +0
[2026/07/22 10:07:24.765] at Context.<anonymous> (src/cli-repl-gc.spec.ts:111:72)
[2026/07/22 10:07:24.765] at processTicksAndRejections (node:internal/process/task_queues:104:5)
[2026/07/22 10:07:25.031] 2026-07-22T14:07:24.757Z mongodb-runner stopped running process
[2026/07/22 10:07:25.031] npm verbose stack Error: command failed
[2026/07/22 10:07:25.031] npm verbose stack at promiseSpawn (/opt/<REDACTED:macos_notary_key>/node24/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
[2026/07/22 10:07:25.031] npm verbose stack at spawnWithShell (/opt/<REDACTED:macos_notary_key>/node24/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
[2026/07/22 10:07:25.031] npm verbose stack at promiseSpawn (/opt/<REDACTED:macos_notary_key>/node24/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
[2026/07/22 10:07:25.031] npm verbose stack at runScriptPkg (/opt/<REDACTED:macos_notary_key>/node24/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:79:13)
[2026/07/22 10:07:25.031] npm verbose stack at runScript (/opt/<REDACTED:macos_notary_key>/node24/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
[2026/07/22 10:07:25.031] npm verbose stack at #run (/opt/<REDACTED:macos_notary_key>/node24/lib/node_modules/npm/lib/commands/run.js:135:13)
[2026/07/22 10:07:25.031] npm verbose stack at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
[2026/07/22 10:07:25.031] npm verbose stack at async RunScript.execWorkspaces (/opt/<REDACTED:macos_notary_key>/node24/lib/node_modules/npm/lib/commands/run.js:67:9)
[2026/07/22 10:07:25.031] npm verbose stack at async Npm.exec (/opt/<REDACTED:macos_notary_key>/node24/lib/node_modules/npm/lib/npm.js:208:9)
[2026/07/22 10:07:25.031] npm verbose stack at async module.exports (/opt/<REDACTED:macos_notary_key>/node24/lib/node_modules/npm/lib/cli/entry.js:67:5)