summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/async-hooks/test-graph.signal.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/async-hooks/test-graph.signal.js b/test/async-hooks/test-graph.signal.js
index 92334b9826..770fe00da4 100644
--- a/test/async-hooks/test-graph.signal.js
+++ b/test/async-hooks/test-graph.signal.js
@@ -3,16 +3,16 @@
const common = require('../common');
if (common.isWindows) {
common.skip('no signals on Windows');
- return;
}
const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph');
-const exec = require('child_process').exec;
+const { exec } = require('child_process');
const hooks = initHooks();
hooks.enable();
+const interval = setInterval(() => {}, 9999); // keep event loop open
process.on('SIGUSR2', common.mustCall(onsigusr2, 2));
let count = 0;
@@ -33,7 +33,9 @@ function onsigusr2() {
}
}
-function onsigusr2Again() {}
+function onsigusr2Again() {
+ clearInterval(interval); // let the event loop close
+}
process.on('exit', onexit);