mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
@@ -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;
|
||||
@@ -38,6 +37,7 @@ timeoutd.run(function() {
|
||||
}, 0).unref();
|
||||
|
||||
t = setTimeout(function() {
|
||||
clearTimeout(timeout);
|
||||
throw new Error('Timeout UNREFd');
|
||||
}, 0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user