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(() => {
|
const t = setInterval(() => {
|
||||||
cntr++;
|
cntr++;
|
||||||
if (cntr === 1) {
|
if (cntr === 1) {
|
||||||
first = Timer.now();
|
|
||||||
common.busyLoop(100);
|
common.busyLoop(100);
|
||||||
|
first = Timer.now();
|
||||||
} else if (cntr === 2) {
|
} else if (cntr === 2) {
|
||||||
assert(Timer.now() - first < 120);
|
assert(Timer.now() - first < 100);
|
||||||
clearInterval(t);
|
clearInterval(t);
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user