File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
packages/core/src/runtime/worker Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import type {
5
5
TestFileResult ,
6
6
WorkerState ,
7
7
} from '../../types' ;
8
+ import './setup' ;
8
9
import { globalApis } from '../../utils/constants' ;
9
10
import { undoSerializableConfig } from '../../utils/helper' ;
10
11
import { formatTestError } from '../util' ;
Original file line number Diff line number Diff line change
1
+ const gracefulExit : boolean = process . execArgv . some (
2
+ ( execArg ) =>
3
+ execArg . startsWith ( '--prof' ) ||
4
+ execArg . startsWith ( '--cpu-prof' ) ||
5
+ execArg . startsWith ( '--heap-prof' ) ||
6
+ execArg . startsWith ( '--diagnostic-dir' ) ,
7
+ ) ;
8
+
9
+ if ( gracefulExit ) {
10
+ // gracefully handle SIGTERM to generate CPU profile
11
+ // https://github.com/nodejs/node/issues/55094
12
+ process . on ( 'SIGTERM' , ( ) => {
13
+ process . exit ( ) ;
14
+ } ) ;
15
+ }
You can’t perform that action at this time.
0 commit comments