We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f89efbc commit b016cbbCopy full SHA for b016cbb
test/async-hooks/test-graph.signal.js
@@ -3,16 +3,16 @@
3
const common = require('../common');
4
if (common.isWindows) {
5
common.skip('no signals on Windows');
6
- return;
7
}
8
9
const initHooks = require('./init-hooks');
10
const verifyGraph = require('./verify-graph');
11
-const exec = require('child_process').exec;
+const { exec } = require('child_process');
12
13
const hooks = initHooks();
14
15
hooks.enable();
+const interval = setInterval(() => {}, 9999); // keep event loop open
16
process.on('SIGUSR2', common.mustCall(onsigusr2, 2));
17
18
let count = 0;
@@ -33,7 +33,9 @@ function onsigusr2() {
33
34
35
36
-function onsigusr2Again() {}
+function onsigusr2Again() {
37
+ clearInterval(interval); // let the event loop close
38
+}
39
40
process.on('exit', onexit);
41
0 commit comments