Skip to content

Commit

Permalink
test: deflake test/pummel/test-timers.js
Browse files Browse the repository at this point in the history
PR-URL: #55098
Fixes: #55092
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
jakecastelli authored and marco-ippolito committed Nov 17, 2024
1 parent 80edcdf commit 81bcec0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/pummel/test-timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const WINDOW = 200; // Why does this need to be so big?
assert.ok(diff > 0);
console.error(`diff: ${diff}`);

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

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

const t = interval_count * 1000;

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

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

0 comments on commit 81bcec0

Please sign in to comment.