From 213cbac68fa2edc0187b1f02b23532d6eedd5c74 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 27 Aug 2023 17:14:28 +0200 Subject: [PATCH] test: add missing pool destroy() calls MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- tests/pools/abstract/abstract-pool.test.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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 () => { -- 2.34.1