File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -126,11 +126,16 @@ function setup(root){
126126}
127127} ;
128128
129+ const terminationHandler = ( ) => {
130+ exitHandler ( ) ;
131+ process . exit ( ) ;
132+ }
133+
129134process . on ( 'uncaughtException' , exceptionHandler ) ;
130135process . on ( 'unhandledRejection' , rejectionHandler ) ;
131136process . on ( 'beforeExit' , exitHandler ) ;
132- process . on ( 'SIGINT' , exitHandler ) ;
133- process . on ( 'SIGTERM' , exitHandler ) ;
137+ process . on ( 'SIGINT' , terminationHandler ) ;
138+ process . on ( 'SIGTERM' , terminationHandler ) ;
134139
135140root . reporter . pipe ( process . stdout ) ;
136141root . reporter . version ( ) ;
Original file line number Diff line number Diff line change 22require ( '../common' ) ;
33const assert = require ( 'assert' ) ;
44const { spawnSync } = require ( 'child_process' ) ;
5+ const { setTimeout } = require ( 'timers/promises' ) ;
56
67if ( process . argv [ 2 ] === 'child' ) {
78const test = require ( 'node:test' ) ;
@@ -18,7 +19,7 @@ if (process.argv[2] === 'child'){
1819} else if ( process . argv [ 3 ] === 'never_ends' ) {
1920assert . strictEqual ( process . argv [ 3 ] , 'never_ends' ) ;
2021test ( 'never ending test' , ( ) => {
21- return new Promise ( ( ) => { } ) ;
22+ return setTimeout ( 100_000_000 ) ;
2223} ) ;
2324process . kill ( process . pid , 'SIGINT' ) ;
2425}
You can’t perform that action at this time.
0 commit comments