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 441b545

Browse filesBrowse files
addaleaxrvagg
authored andcommitted
test: fix flaky test-worker-ref-onexit
Fixes: #26167 PR-URL: #26170 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
1 parent dab64bb commit 441b545
Copy full SHA for 441b545

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎test/parallel/test-worker-ref-onexit.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-worker-ref-onexit.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const { Worker } = require('worker_threads');
55
// Check that worker.unref() makes the 'exit' event not be emitted, if it is
66
// the only thing we would otherwise be waiting for.
77

8-
const w = new Worker('', { eval: true });
8+
// Use `setInterval()` to make sure the worker is alive until the end of the
9+
// event loop turn.
10+
const w = new Worker('setInterval(() => {}, 100);', { eval: true });
911
w.unref();
1012
w.on('exit', common.mustNotCall());

0 commit comments

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