From: Jérôme Benoit Date: Wed, 12 Oct 2022 21:55:21 +0000 (+0200) Subject: Tests: remove unused variables X-Git-Tag: v2.3.1~12 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8cbb82eb0f90b5c816bb0216e8509540e4dbb54a;p=poolifier.git Tests: remove unused variables Signed-off-by: Jérôme Benoit --- 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.