Skip to content

Commit e99d4a4

Browse files
jakecastellitargos
authored andcommitted
test: deflake test/pummel/test-timers.js
PR-URL: #55098 Fixes: #55092 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent fd40f08 commit e99d4a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/pummel/test-timers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const WINDOW = 200; // Why does this need to be so big?
3636
assert.ok(diff > 0);
3737
console.error(`diff: ${diff}`);
3838

39-
assert.ok(1000 <= diff && diff < 1000 + WINDOW);
39+
assert.ok(Math.abs(diff - 1000) < WINDOW);
4040
}), 1000);
4141
}
4242

@@ -61,7 +61,7 @@ const WINDOW = 200; // Why does this need to be so big?
6161

6262
const t = interval_count * 1000;
6363

64-
assert.ok(t <= diff && diff < t + (WINDOW * interval_count));
64+
assert.ok(Math.abs(diff - t) < WINDOW * interval_count);
6565

6666
assert.ok(interval_count <= 3, `interval_count: ${interval_count}`);
6767
if (interval_count === 3)

0 commit comments

Comments
 (0)