From: Jérôme Benoit Date: Sun, 27 Aug 2023 15:14:28 +0000 (+0200) Subject: test: add missing pool destroy() calls X-Git-Tag: v2.6.37~30 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=213cbac68fa2edc0187b1f02b23532d6eedd5c74;p=poolifier.git test: add missing pool destroy() calls Signed-off-by: Jérôme Benoit --- diff --git a/tests/pools/abstract/abstract-pool.test.js b/tests/pools/abstract/abstract-pool.test.js index 945ee8e7..75b0a35c 100644 --- a/tests/pools/abstract/abstract-pool.test.js +++ b/tests/pools/abstract/abstract-pool.test.js @@ -154,22 +154,22 @@ describe('Abstract pool test suite', () => { ) expect( () => - new DynamicClusterPool( - 1, - 1, - './tests/worker-files/cluster/testWorker.js' - ) + new DynamicThreadPool(0, 0, './tests/worker-files/thread/testWorker.js') ).toThrowError( new RangeError( - 'Cannot instantiate a dynamic pool with a minimum pool size equal to the maximum pool size. Use a fixed pool instead' + 'Cannot instantiate a dynamic pool with a maximum pool size equal to zero' ) ) expect( () => - new DynamicThreadPool(0, 0, './tests/worker-files/thread/testWorker.js') + new DynamicClusterPool( + 1, + 1, + './tests/worker-files/cluster/testWorker.js' + ) ).toThrowError( new RangeError( - 'Cannot instantiate a dynamic pool with a maximum pool size equal to zero' + 'Cannot instantiate a dynamic pool with a minimum pool size equal to the maximum pool size. Use a fixed pool instead' ) ) }) @@ -799,6 +799,7 @@ describe('Abstract pool test suite', () => { expect(workerNode.tasksQueue.size).toBe(0) expect(workerNode.tasksQueue.maxSize).toBe(0) } + await pool.destroy() }) it('Verify that pool worker info are initialized', async () => { @@ -828,6 +829,7 @@ describe('Abstract pool test suite', () => { ready: true }) } + await pool.destroy() }) it('Verify that pool execute() arguments are checked', async () => {