From: Jérôme Benoit Date: Sun, 9 Oct 2022 23:10:10 +0000 (+0200) Subject: Fix missed Promise.all usage in tests X-Git-Tag: v2.3.1~47 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7b6860ef4b85ce0243f39f12f80f22f0ad778cef;p=poolifier.git Fix missed Promise.all usage in tests Signed-off-by: Jérôme Benoit --- diff --git a/tests/pools/cluster/dynamic.test.js b/tests/pools/cluster/dynamic.test.js index 02a02287..61e1d6e2 100644 --- a/tests/pools/cluster/dynamic.test.js +++ b/tests/pools/cluster/dynamic.test.js @@ -26,7 +26,6 @@ describe('Dynamic cluster pool test suite', () => { for (let i = 0; i < max * 2; i++) { promises.push(pool.execute({ test: 'test' })) } - // await Promise.all(promises) expect(pool.workers.length).toBeLessThanOrEqual(max) expect(pool.workers.length).toBeGreaterThan(min) // The `busy` event is triggered when the number of submitted tasks at once reach the max number of workers in the dynamic pool. diff --git a/tests/pools/thread/dynamic.test.js b/tests/pools/thread/dynamic.test.js index 8558cb6f..94320429 100644 --- a/tests/pools/thread/dynamic.test.js +++ b/tests/pools/thread/dynamic.test.js @@ -26,7 +26,6 @@ describe('Dynamic thread pool test suite', () => { for (let i = 0; i < max * 2; i++) { promises.push(pool.execute({ test: 'test' })) } - // await Promise.all(promises) expect(pool.workers.length).toBeLessThanOrEqual(max) expect(pool.workers.length).toBeGreaterThan(min) // The `busy` event is triggered when the number of submitted tasks at once reach the max number of workers in the dynamic pool. diff --git a/tests/pools/thread/fixed.test.js b/tests/pools/thread/fixed.test.js index 9af4417c..785c6e5d 100644 --- a/tests/pools/thread/fixed.test.js +++ b/tests/pools/thread/fixed.test.js @@ -74,7 +74,6 @@ describe('Fixed thread pool test suite', () => { for (let i = 0; i < numberOfThreads * 2; i++) { promises.push(pool.execute({ test: 'test' })) } - // await Promise.all(promises) // The `busy` event is triggered when the number of submitted tasks at once reach the number of fixed pool workers. // So in total numberOfThreads + 1 times for a loop submitting up to numberOfThreads * 2 tasks to the fixed pool. expect(poolBusy).toBe(numberOfThreads + 1)