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
test: fix flaky test-domain-timers
It's possible for this test to be extremely infrequently flaky if
1ms or more elapses between setting the two timeouts. In that case,
the second timer will not fire and the test will fail.
  • Loading branch information
apapirovski committed May 29, 2018
commit b1155de6e232d603679d6a8ae796e831368aa814
2 changes: 1 addition & 1 deletion test/parallel/test-domain-timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const timeoutd = domain.create();

timeoutd.on('error', common.mustCall(function(e) {
assert.strictEqual(e.message, 'Timeout UNREFd');
clearTimeout(timeout);
}, 2));

let t;
Expand All @@ -38,6 +37,7 @@ timeoutd.run(function() {
}, 0).unref();

t = setTimeout(function() {
clearTimeout(timeout);
throw new Error('Timeout UNREFd');
}, 0);
});
Expand Down