diff --git a/test/fixtures/process/finalization-cleanup.mjs b/test/fixtures/process/finalization-cleanup.mjs index 88d6c17cc7e3..8b7705b64d61 100644 --- a/test/fixtures/process/finalization-cleanup.mjs +++ b/test/fixtures/process/finalization-cleanup.mjs @@ -30,5 +30,7 @@ for (let i = 0; i < 10; i++) { } process.on('exit', function () { + // Keep `first` and `third` alive until exit; registrations only hold them weakly. + deepStrictEqual(keptAlive.map((obj) => obj.name), ['first', 'third']) deepStrictEqual(finalized, ['first', 'third']) }) diff --git a/test/fixtures/process/unregister-function.mjs b/test/fixtures/process/unregister-function.mjs index b74a5b8203a0..01f704e4fa15 100644 --- a/test/fixtures/process/unregister-function.mjs +++ b/test/fixtures/process/unregister-function.mjs @@ -25,5 +25,8 @@ unregisterABeforeExit() unregisterBAgain() process.on('exit', function () { + // Keep `a` and `b` alive until exit; registrations only hold them weakly. + strictEqual(a.name, 'a') + strictEqual(b.name, 'b') strictEqual(calls.join(','), 'b:exit') })