Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/async-hooks/test-graph.signal.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,20 +16,20 @@ hooks.enable();
process.on('SIGUSR2', common.mustCall(onsigusr2, 2));

let count = 0;
exec('kill -USR2 ' + process.pid);
exec(`kill -USR2 ${process.pid}`);

function onsigusr2(){
count++;

if (count === 1){
// trigger same signal handler again
exec('kill -USR2 ' + process.pid);
exec(`kill -USR2 ${process.pid}`);
} else{
// install another signal handler
process.removeAllListeners('SIGUSR2');
process.on('SIGUSR2', common.mustCall(onsigusr2Again));

exec('kill -USR2 ' + process.pid);
exec(`kill -USR2 ${process.pid}`);
}
}

Expand Down