From 90afa746b6ca3e64140eadc745e8d62e8ac075c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 21 Dec 2023 12:15:43 +0100 Subject: [PATCH] test: fix pool destroy() test flakiness MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- tests/pools/abstract-pool.test.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) }) -- 2.34.1