Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b016cbb

Browse filesBrowse files
Trottgibfahn
authored andcommitted
test: fix flaky async-hooks/test-graph.signal
Make sure event loop remains open long enough for signal to be received. PR-URL: #17509 Fixes: #14568 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
1 parent f89efbc commit b016cbb
Copy full SHA for b016cbb

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Open diff view settings
Collapse file

‎test/async-hooks/test-graph.signal.js‎

Copy file name to clipboardExpand all lines: test/async-hooks/test-graph.signal.js
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
const common = require('../common');
44
if (common.isWindows) {
55
common.skip('no signals on Windows');
6-
return;
76
}
87

98
const initHooks = require('./init-hooks');
109
const verifyGraph = require('./verify-graph');
11-
const exec = require('child_process').exec;
10+
const { exec } = require('child_process');
1211

1312
const hooks = initHooks();
1413

1514
hooks.enable();
15+
const interval = setInterval(() => {}, 9999); // keep event loop open
1616
process.on('SIGUSR2', common.mustCall(onsigusr2, 2));
1717

1818
let count = 0;
@@ -33,7 +33,9 @@ function onsigusr2() {
3333
}
3434
}
3535

36-
function onsigusr2Again() {}
36+
function onsigusr2Again() {
37+
clearInterval(interval); // let the event loop close
38+
}
3739

3840
process.on('exit', onexit);
3941

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.