Version
23.4
Platform
Linux minitower 6.12.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 10 Jan 2025 00:39:41 +0000 x86_64 GNU/Linux
Subsystem
node:test
What steps will reproduce the bug?
const{run}=require('node:test');constt0=Date.now()consts=run({isolation: 'none',files: [__dirname+'/code.test.js'],// timeout: 2000, // no effect// forceExit: true, // no effect});['close','error','data','end','finish'].forEach(e=>{s.on(e,x=>console.log(Date.now()-t0,e,x?.type))});setTimeout(()=>{console.log('************* t=3000')},3000)/*5 data test:enqueue5 data test:dequeue5 data test:enqueue6 data test:complete6 data test:start6 data test:pass6 data test:dequeue6 data test:complete6 data test:start6 data test:fail************* t=30003006 data test:plan3006 data test:diagnostic3006 data test:diagnostic3006 data test:diagnostic3006 data test:diagnostic3006 data test:diagnostic3006 data test:diagnostic3006 data test:diagnostic3006 data test:diagnostic3006 data test:summary3007 end undefined3007 close undefined*/And if we were to emit a "beforeExit" event:
setTimeout(()=>{console.log('************* beforeExit')process.emit('beforeExit')},1500)/*4 data test:enqueue5 data test:dequeue5 data test:enqueue6 data test:complete6 data test:start6 data test:pass6 data test:dequeue6 data test:complete6 data test:start6 data test:fail************* beforeExit1504 data test:plan1504 data test:diagnostic1504 data test:diagnostic1504 data test:diagnostic1504 data test:diagnostic1504 data test:diagnostic1504 data test:diagnostic1504 data test:diagnostic1504 data test:diagnostic1504 data test:summary1504 end undefined1505 close undefined************* t=3000*/How often does it reproduce? Is there a required condition?
100% reproduceable.
What is the expected behavior? Why is that the expected behavior?
test runner should end after all planned tests are complete.
OR
it should allow me to explicitly declare my test plan so it knows after the Nth test that no more tests are gonig to be enqueued.
What do you see instead?
test runner waits for the "beforeExit" event before it terminates.
Additional information
No response
Version
23.4
Platform
Subsystem
node:test
What steps will reproduce the bug?
And if we were to emit a "beforeExit" event:
How often does it reproduce? Is there a required condition?
100% reproduceable.
What is the expected behavior? Why is that the expected behavior?
test runner should end after all planned tests are complete.
OR
it should allow me to explicitly declare my test plan so it knows after the Nth test that no more tests are gonig to be enqueued.
What do you see instead?
test runner waits for the "beforeExit" event before it terminates.
Additional information
No response