X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fpools%2Fthread%2Fdynamic.test.mjs;h=77c5aaeb5afd3893c8c7eb265a7d65ed4d3cdda6;hb=423e70bd0583811e33d41d94e2fda10a03641b47;hp=2b5dd6112fac7c9664ec6a0ad7a0ce027aa4f371;hpb=8e8d9101768c28914dabc95c14740985e18f1f04;p=poolifier.git diff --git a/tests/pools/thread/dynamic.test.mjs b/tests/pools/thread/dynamic.test.mjs index 2b5dd611..77c5aaeb 100644 --- a/tests/pools/thread/dynamic.test.mjs +++ b/tests/pools/thread/dynamic.test.mjs @@ -158,14 +158,16 @@ describe('Dynamic thread pool test suite', () => { }) it('Verify that a pool with zero worker works', async () => { - const pool = new DynamicThreadPool( - 0, - max, - './tests/worker-files/thread/testWorker.mjs' - ) - expect(pool.starting).toBe(false) for (const workerChoiceStrategy of Object.values(WorkerChoiceStrategies)) { - pool.setWorkerChoiceStrategy(workerChoiceStrategy) + const pool = new DynamicThreadPool( + 0, + max, + './tests/worker-files/thread/testWorker.mjs', + { + workerChoiceStrategy + } + ) + expect(pool.starting).toBe(false) expect(pool.readyEventEmitted).toBe(false) for (let run = 0; run < 2; run++) { run % 2 !== 0 && pool.enableTasksQueue(true) @@ -183,8 +185,8 @@ describe('Dynamic thread pool test suite', () => { expect(pool.readyEventEmitted).toBe(false) expect(pool.workerNodes.length).toBe(pool.info.minSize) } + // We need to clean up the resources after our test + await pool.destroy() } - // We need to clean up the resources after our test - await pool.destroy() }) })