test: fix flaky interval test
PR-URL: https://github.com/nodejs/node/pull/18161 Fixes: https://github.com/nodejs/node/issues/18160 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
dbdcf12187
commit
b88da496ef
@ -8,10 +8,10 @@ let first;
|
||||
const t = setInterval(() => {
|
||||
cntr++;
|
||||
if (cntr === 1) {
|
||||
first = Timer.now();
|
||||
common.busyLoop(100);
|
||||
first = Timer.now();
|
||||
} else if (cntr === 2) {
|
||||
assert(Timer.now() - first < 120);
|
||||
assert(Timer.now() - first < 100);
|
||||
clearInterval(t);
|
||||
}
|
||||
}, 100);
|
||||
|
Loading…
x
Reference in New Issue
Block a user