From: Jérôme Benoit Date: Thu, 21 Dec 2023 11:15:43 +0000 (+0100) Subject: test: fix pool destroy() test flakiness X-Git-Tag: v3.1.9~11 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=90afa746b6ca3e64140eadc745e8d62e8ac075c8;p=poolifier.git test: fix pool destroy() test flakiness Signed-off-by: Jérôme Benoit --- diff --git a/tests/pools/abstract-pool.test.mjs b/tests/pools/abstract-pool.test.mjs index 78fcd2da..0e363cb8 100644 --- a/tests/pools/abstract-pool.test.mjs +++ b/tests/pools/abstract-pool.test.mjs @@ -1298,7 +1298,8 @@ describe('Abstract pool test suite', () => { const startTime = performance.now() await pool.destroy() const elapsedTime = performance.now() - startTime - expect(tasksFinished).toBe(numberOfWorkers * maxMultiplier) + expect(tasksFinished).toBeGreaterThanOrEqual(numberOfWorkers) + expect(tasksFinished).toBeLessThanOrEqual(numberOfWorkers * maxMultiplier) expect(elapsedTime).toBeGreaterThanOrEqual(2000) expect(elapsedTime).toBeLessThanOrEqual(tasksFinishedTimeout + 100) })