X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fpools%2Fcluster%2Ffixed.test.js;h=52ba58d7114cd78f89b4d46f8f5b7b8c992d5501;hb=42f051a803bbf4dc378802f624e308debe61c53f;hp=2ef709c1d0fc71fa3d6da9af508d8afa3859d5cf;hpb=ac1417a5d54f03b1575de1a53073182ea5f4e2ef;p=poolifier.git diff --git a/tests/pools/cluster/fixed.test.js b/tests/pools/cluster/fixed.test.js index 2ef709c1..52ba58d7 100644 --- a/tests/pools/cluster/fixed.test.js +++ b/tests/pools/cluster/fixed.test.js @@ -74,6 +74,7 @@ describe('Fixed cluster pool test suite', () => { for (let i = 0; i < numberOfWorkers * 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 numberOfWorkers + 1 times for a loop submitting up to numberOfWorkers * 2 tasks to the fixed pool. expect(poolBusy).toBe(numberOfWorkers + 1)