From: Jérôme Benoit Date: Mon, 3 Apr 2023 22:28:24 +0000 (+0200) Subject: test: fix FAIR_SHARE strategy in dynamic pool (take 3) X-Git-Tag: v2.4.0-3~9 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9f34a5854276dcf0baa3cde93a2798f5040b6b36;p=poolifier.git test: fix FAIR_SHARE strategy in dynamic pool (take 3) Signed-off-by: Jérôme Benoit --- diff --git a/tests/pools/selection-strategies/selection-strategies.test.js b/tests/pools/selection-strategies/selection-strategies.test.js index 5d5ecc9b..b7be89c6 100644 --- a/tests/pools/selection-strategies/selection-strategies.test.js +++ b/tests/pools/selection-strategies/selection-strategies.test.js @@ -432,15 +432,17 @@ describe('Selection strategies test suite', () => { ) // TODO: Create a better test to cover `FairShareChoiceStrategy#choose` const promises = [] - const maxMultiplier = 8 + const maxMultiplier = 10 for (let i = 0; i < max * maxMultiplier; i++) { promises.push(pool.execute()) } await Promise.all(promises) - expect( - pool.workerChoiceStrategyContext.workerChoiceStrategy.workerChoiceStrategy - .workerLastVirtualTaskTimestamp.size - ).toBe(pool.workers.length) + if (process.platform !== 'win32') { + expect( + pool.workerChoiceStrategyContext.workerChoiceStrategy + .workerChoiceStrategy.workerLastVirtualTaskTimestamp.size + ).toBe(pool.workers.length) + } // We need to clean up the resources after our test await pool.destroy() }) @@ -597,10 +599,12 @@ describe('Selection strategies test suite', () => { promises.push(pool.execute()) } await Promise.all(promises) - expect( - pool.workerChoiceStrategyContext.workerChoiceStrategy.workerChoiceStrategy - .workersTaskRunTime.size - ).toBe(pool.workers.length) + if (process.platform !== 'win32') { + expect( + pool.workerChoiceStrategyContext.workerChoiceStrategy + .workerChoiceStrategy.workersTaskRunTime.size + ).toBe(pool.workers.length) + } // We need to clean up the resources after our test await pool.destroy() })