Skip to content

Commit

Permalink
test: fix flaky test-worker-ref-onexit
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Feb 17, 2019
1 parent c077c21 commit ed878c2
Showing 1 changed file with 3 additions and 1 deletion.
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());

0 comments on commit ed878c2

Please sign in to comment.