Repository navigation
bug(runtime-host): tests fail on Node 22, which engines declares as supported but CI never runs #5640
Description
What happened
The root package.json declares "engines": { "node": ">=22.19.0" }, but every test job in ci.yml runs Node 24. A contributor who follows the declared range and uses Node 22 sees Runtime Host failures that do not exist on Node 24, with messages that do not point at the cause.
Measured on one machine, same checkout, same build, only the Node binary changed:
| Suite | Node 22.23.1 | Node 24.21.0 |
|---|---|---|
packages/runtime-host/dist/__tests__/resumable-peer-stream.test.js |
4 passed, 6 cancelled | 10 passed |
packages/storage/dist/__tests__/managed-dependency-environment-crash.test.js |
4 passed, 1 failed | 5 passed |
@maka/runtime-host full test:dist |
2070 passed, 19 not passing | 2074 passed, 3 failed |
Two distinct causes are behind these.
1. Unreferenced heartbeat timer, reported as a cancelled test. ResumablePeerStream creates its heartbeat interval and immediately unrefs it (packages/runtime-host/src/transport/resumable-peer-stream.ts:117). Tests whose progress depends on that heartbeat driving recovery then have nothing else holding the loop open while they wait. Node 22's test runner treats that as a drained loop and cancels the test:
failureType: 'cancelledByParent'
error: 'Promise resolution is still pending but the event loop has already resolved'
The first four tests in the file do not use heartbeats and pass; the remaining six are cancelled. Node 24's runner keeps them alive and all ten pass. The cancellations are deterministic on Node 22 across repeated runs, not intermittent.
2. node:sqlite experimental warning read as a failure. rejects a second authority for the same storage root in another process asserts on a child process's stderr. On Node 22 node:sqlite is still experimental and emits ExperimentalWarning: SQLite is an experimental feature, which the assertion treats as failure output. On Node 24 the module is stable, nothing is written, and the test passes.
Neither failure is visible in CI, because no test job runs Node 22. ci.yml pins node-version: '24'; the only workflow pinning 22.19.0 is cli-package-validation.yml, which validates an installed CLI and does not run the Runtime Host or storage suites.
Expected: either the declared range matches what is tested, or these tests pass on every version the range accepts.
How to reproduce
- Install Node 22 (22.23.1 used here) and Node 24 (24.21.0 used here).
npm ci && npm run build- Run the same file under each:
node --test packages/runtime-host/dist/__tests__/resumable-peer-stream.test.js
node --test packages/storage/dist/__tests__/managed-dependency-environment-crash.test.js- On Node 22, six tests in the first file report
cancelledand one test in the second reportsfail. On Node 24, both files pass completely.
Environment
- Maka commit:
9082cf144(main) - OS: macOS 26.5.2, arm64
- Node.js: v22.23.1 and v24.21.0, same checkout and build
- npm: 11.19.0
- Surface: Runtime Host, storage
Logs, screenshots, or additional context
Related but not the same defect: #5290 and #5291 cover Node 23 lacking node:sqlite DatabaseSync.isTransaction, and #5291 narrows the range to ^22.19.0 || >=24.0.0. That change excludes 23 and leaves 22 supported, so it does not affect either failure above.
Analysis produced with Claude Code; the two Node runs and the source locations above were reviewed by me.
Activity
[-]Runtime Host tests fail on Node 22, which engines declares as supported but CI never runs[/-][+]bug(runtime-host): tests fail on Node 22, which engines declares as supported but CI never runs[/+]seekskyworld commentedon Sep 24, 2026
take