Summary
borp --expose-gc no longer guarantees that global.gc is available inside test files on newer Node.js releases.
This appears to be due to a Node.js test runner regression introduced in Node 24.7.0, where V8-only CLI flags such as --expose-gc are not propagated to isolated child test processes.
Because borp exposes a --expose-gc option, it may make sense for borp to work around this upstream regression by normalizing the flag into NODE_OPTIONS=--expose-gc (or otherwise ensuring the child test process receives it).
Reproduction
With a test file like:
const { test } = require('node:test')
test('gc visible', () => {
if (typeof global.gc !== 'function') {
throw new Error('gc missing')
}
})
On Node 24.7.0+:
borp --expose-gc -p "test/gc.js"
fails because global.gc is missing in the test file.
But this works:
NODE_OPTIONS=--expose-gc borp -p "test/gc.js"
Version check
I reproduced this split locally:
- works: Node 22.21.1, 23.11.1, 24.0.0, 24.6.0
- broken: Node 24.7.0, 24.8.0, 24.13.0, 25.2.1
Upstream references
Suggestion
When --expose-gc is passed to borp, consider setting/appending NODE_OPTIONS=--expose-gc before invoking the Node test runner instead of relying only on the CLI flag reaching child test processes.
Summary
borp --expose-gcno longer guarantees thatglobal.gcis available inside test files on newer Node.js releases.This appears to be due to a Node.js test runner regression introduced in Node 24.7.0, where V8-only CLI flags such as
--expose-gcare not propagated to isolated child test processes.Because
borpexposes a--expose-gcoption, it may make sense forborpto work around this upstream regression by normalizing the flag intoNODE_OPTIONS=--expose-gc(or otherwise ensuring the child test process receives it).Reproduction
With a test file like:
On Node 24.7.0+:
borp --expose-gc -p "test/gc.js"fails because
global.gcis missing in the test file.But this works:
NODE_OPTIONS=--expose-gc borp -p "test/gc.js"Version check
I reproduced this split locally:
Upstream references
Suggestion
When
--expose-gcis passed toborp, consider setting/appendingNODE_OPTIONS=--expose-gcbefore invoking the Node test runner instead of relying only on the CLI flag reaching child test processes.