Skip to content

Commit 7e1f610

Browse files
apapirovskiaddaleax
authored andcommitted
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. PR-URL: #21019 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
1 parent 2bbd99c commit 7e1f610

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎test/parallel/test-domain-timers.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const timeoutd = domain.create();
2828

2929
timeoutd.on('error',common.mustCall(function(e){
3030
assert.strictEqual(e.message,'Timeout UNREFd');
31-
clearTimeout(timeout);
3231
},2));
3332

3433
lett;
@@ -38,6 +37,7 @@ timeoutd.run(function() {
3837
},0).unref();
3938

4039
t=setTimeout(function(){
40+
clearTimeout(timeout);
4141
thrownewError('Timeout UNREFd');
4242
},0);
4343
});

0 commit comments

Comments
 (0)