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
4 changes: 3 additions & 1 deletion test/parallel/test-worker-ref-onexit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const { Worker } = require('worker_threads');
// Check that worker.unref() makes the 'exit' event not be emitted, if it is
// the only thing we would otherwise be waiting for.

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