From: Jérôme Benoit Date: Fri, 25 Aug 2023 22:52:18 +0000 (+0200) Subject: test: fix flakiness X-Git-Tag: v2.6.36~22 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=65deb7f0f59f285c1ebcadf5e5491eb95a6b4ffe;p=poolifier.git test: fix flakiness Signed-off-by: Jérôme Benoit --- diff --git a/tests/utils.test.js b/tests/utils.test.js index c00f0307..42a0668a 100644 --- a/tests/utils.test.js +++ b/tests/utils.test.js @@ -27,10 +27,10 @@ describe('Utils test suite', () => { }) it('Verify sleep() behavior', async () => { - const now = performance.now() + const start = performance.now() await sleep(1000) - const elapsed = performance.now() - now - expect(elapsed).toBeGreaterThanOrEqual(1000) + const stop = performance.now() + expect(stop - start).toBeGreaterThanOrEqual(1000) }) it('Verify exponentialDelay() behavior', () => {