From 8cbb82eb0f90b5c816bb0216e8509540e4dbb54a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 12 Oct 2022 23:55:21 +0200 Subject: [PATCH] Tests: remove unused variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- tests/pools/cluster/dynamic.test.js | 3 +-- tests/pools/cluster/fixed.test.js | 3 +-- tests/pools/thread/dynamic.test.js | 3 +-- tests/pools/thread/fixed.test.js | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/pools/cluster/dynamic.test.js b/tests/pools/cluster/dynamic.test.js index 1e7fb870..b1fd166e 100644 --- a/tests/pools/cluster/dynamic.test.js +++ b/tests/pools/cluster/dynamic.test.js @@ -27,11 +27,10 @@ describe('Dynamic cluster pool test suite', () => { }) it('Verify that new workers are created when required, max size is not exceeded and that after a while new workers will die', async () => { - const promises = [] let poolBusy = 0 pool.emitter.on('busy', () => poolBusy++) for (let i = 0; i < max * 2; i++) { - promises.push(pool.execute()) + pool.execute() } expect(pool.workers.length).toBeLessThanOrEqual(max) expect(pool.workers.length).toBeGreaterThan(min) diff --git a/tests/pools/cluster/fixed.test.js b/tests/pools/cluster/fixed.test.js index 4c36d8eb..a05ccc0f 100644 --- a/tests/pools/cluster/fixed.test.js +++ b/tests/pools/cluster/fixed.test.js @@ -74,11 +74,10 @@ describe('Fixed cluster pool test suite', () => { }) it('Verify that busy event is emitted', async () => { - const promises = [] let poolBusy = 0 pool.emitter.on('busy', () => poolBusy++) for (let i = 0; i < numberOfWorkers * 2; i++) { - promises.push(pool.execute()) + pool.execute() } // 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. diff --git a/tests/pools/thread/dynamic.test.js b/tests/pools/thread/dynamic.test.js index 9cd4e72c..fad9dab8 100644 --- a/tests/pools/thread/dynamic.test.js +++ b/tests/pools/thread/dynamic.test.js @@ -27,11 +27,10 @@ describe('Dynamic thread pool test suite', () => { }) it('Verify that new workers are created when required, max size is not exceeded and that after a while new workers will die', async () => { - const promises = [] let poolBusy = 0 pool.emitter.on('busy', () => poolBusy++) for (let i = 0; i < max * 2; i++) { - promises.push(pool.execute()) + pool.execute() } expect(pool.workers.length).toBeLessThanOrEqual(max) expect(pool.workers.length).toBeGreaterThan(min) diff --git a/tests/pools/thread/fixed.test.js b/tests/pools/thread/fixed.test.js index 01622f16..a0fd08c8 100644 --- a/tests/pools/thread/fixed.test.js +++ b/tests/pools/thread/fixed.test.js @@ -74,11 +74,10 @@ describe('Fixed thread pool test suite', () => { }) it('Verify that busy event is emitted', async () => { - const promises = [] let poolBusy = 0 pool.emitter.on('busy', () => poolBusy++) for (let i = 0; i < numberOfThreads * 2; i++) { - promises.push(pool.execute()) + pool.execute() } // 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. -- 2.34.1