From: Jérôme Benoit Date: Mon, 5 Jun 2023 13:54:47 +0000 (+0200) Subject: test: fix tests X-Git-Tag: v2.5.4~16^2~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d44d59539409356fef923fd65115b142a37aaf1b;p=poolifier.git test: fix tests 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 03a4ab7e..b88e489b 100644 --- a/tests/pools/abstract/abstract-pool.test.js +++ b/tests/pools/abstract/abstract-pool.test.js @@ -201,7 +201,8 @@ describe('Abstract pool test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) pool.setWorkerChoiceStrategyOptions({ medRunTime: true }) expect(pool.opts.workerChoiceStrategyOptions).toStrictEqual({ @@ -219,7 +220,8 @@ describe('Abstract pool test suite', () => { medRunTime: true, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) pool.setWorkerChoiceStrategyOptions({ medRunTime: false }) expect(pool.opts.workerChoiceStrategyOptions).toStrictEqual({ @@ -237,7 +239,8 @@ describe('Abstract pool test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) await pool.destroy() }) @@ -346,7 +349,8 @@ describe('Abstract pool test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) } await pool.destroy() @@ -387,7 +391,8 @@ describe('Abstract pool test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) } await Promise.all(promises) @@ -403,7 +408,8 @@ describe('Abstract pool test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) } await pool.destroy() @@ -433,7 +439,8 @@ describe('Abstract pool test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) expect(workerNode.tasksUsage.ran).toBeGreaterThan(0) expect(workerNode.tasksUsage.ran).toBeLessThanOrEqual(maxMultiplier) @@ -451,7 +458,8 @@ describe('Abstract pool test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) expect(workerNode.tasksUsage.runTimeHistory.length).toBe(0) expect(workerNode.tasksUsage.waitTimeHistory.length).toBe(0) diff --git a/tests/pools/selection-strategies/selection-strategies.test.js b/tests/pools/selection-strategies/selection-strategies.test.js index da261e89..e9f5983e 100644 --- a/tests/pools/selection-strategies/selection-strategies.test.js +++ b/tests/pools/selection-strategies/selection-strategies.test.js @@ -129,7 +129,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) await pool.destroy() pool = new DynamicThreadPool( @@ -146,7 +147,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) // We need to clean up the resources after our test await pool.destroy() @@ -177,7 +179,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) } expect( @@ -215,7 +218,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) } expect( @@ -308,7 +312,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) await pool.destroy() pool = new DynamicThreadPool( @@ -325,7 +330,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) // We need to clean up the resources after our test await pool.destroy() @@ -356,7 +362,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) } // We need to clean up the resources after our test @@ -389,7 +396,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) } // We need to clean up the resources after our test @@ -411,7 +419,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) await pool.destroy() pool = new DynamicThreadPool( @@ -428,7 +437,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) // We need to clean up the resources after our test await pool.destroy() @@ -459,7 +469,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) expect(workerNode.tasksUsage.ran).toBeGreaterThan(0) expect(workerNode.tasksUsage.ran).toBeLessThanOrEqual(max * maxMultiplier) @@ -495,7 +506,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) expect(workerNode.tasksUsage.ran).toBeGreaterThan(0) expect(workerNode.tasksUsage.ran).toBeLessThanOrEqual(max * maxMultiplier) @@ -520,7 +532,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) await pool.destroy() pool = new DynamicThreadPool( @@ -537,7 +550,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) // We need to clean up the resources after our test await pool.destroy() @@ -568,7 +582,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) expect(workerNode.tasksUsage.runTime).toBeGreaterThan(0) expect(workerNode.tasksUsage.avgRunTime).toBeGreaterThan(0) @@ -608,7 +623,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) expect(workerNode.tasksUsage.runTime).toBeGreaterThan(0) expect(workerNode.tasksUsage.avgRunTime).toBeGreaterThan(0) @@ -653,7 +669,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) expect(workerNode.tasksUsage.runTime).toBeGreaterThan(0) expect(workerNode.tasksUsage.medRunTime).toBeGreaterThan(0) @@ -756,7 +773,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) await pool.destroy() pool = new DynamicThreadPool( @@ -773,7 +791,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) // We need to clean up the resources after our test await pool.destroy() @@ -804,7 +823,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) expect(workerNode.tasksUsage.ran).toBeGreaterThanOrEqual(0) expect(workerNode.tasksUsage.ran).toBeLessThanOrEqual(max * maxMultiplier) @@ -851,7 +871,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) expect(workerNode.tasksUsage.ran).toBeGreaterThan(0) expect(workerNode.tasksUsage.ran).toBeLessThanOrEqual(max * maxMultiplier) @@ -903,7 +924,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) expect(workerNode.tasksUsage.ran).toBeGreaterThan(0) expect(workerNode.tasksUsage.ran).toBeLessThanOrEqual(max * maxMultiplier) @@ -1018,7 +1040,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) await pool.destroy() pool = new DynamicThreadPool( @@ -1035,7 +1058,8 @@ describe('Selection strategies test suite', () => { medRunTime: false, waitTime: false, avgWaitTime: false, - medWaitTime: false + medWaitTime: false, + elu: false }) // We need to clean up the resources after our test await pool.destroy() @@ -1069,7 +1093,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) } expect( @@ -1129,7 +1154,8 @@ describe('Selection strategies test suite', () => { waitTimeHistory: expect.any(CircularArray), avgWaitTime: 0, medWaitTime: 0, - error: 0 + error: 0, + elu: undefined }) } expect(