X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fpools%2Fselection-strategies%2Fselection-strategies.test.mjs;h=bca3c82b1647e22146b6094321d7c9ac60485403;hb=c1d4808dda55cd9ca2c7fdd5ccc330c3a7642a35;hp=39a2ccc3f7ce0cd84ad995165a85a9227341c688;hpb=d35e571704515a8b729d3455e4784054f07c368f;p=poolifier.git diff --git a/tests/pools/selection-strategies/selection-strategies.test.mjs b/tests/pools/selection-strategies/selection-strategies.test.mjs index 39a2ccc3..bca3c82b 100644 --- a/tests/pools/selection-strategies/selection-strategies.test.mjs +++ b/tests/pools/selection-strategies/selection-strategies.test.mjs @@ -66,19 +66,6 @@ describe('Selection strategies test suite', () => { expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe( workerChoiceStrategy ) - expect(pool.opts.workerChoiceStrategyOptions).toBeUndefined() - expect(pool.workerChoiceStrategyContext.opts).toStrictEqual({ - retries: - pool.info.maxSize + - Object.keys(pool.workerChoiceStrategyContext.opts.weights).length, - runTime: { median: false }, - waitTime: { median: false }, - elu: { median: false }, - weights: expect.objectContaining({ - 0: expect.any(Number), - [pool.info.maxSize - 1]: expect.any(Number) - }) - }) await pool.destroy() } for (const workerChoiceStrategy of Object.values(WorkerChoiceStrategies)) { @@ -92,19 +79,6 @@ describe('Selection strategies test suite', () => { expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe( workerChoiceStrategy ) - expect(pool.opts.workerChoiceStrategyOptions).toBeUndefined() - expect(pool.workerChoiceStrategyContext.opts).toStrictEqual({ - retries: - pool.info.maxSize + - Object.keys(pool.workerChoiceStrategyContext.opts.weights).length, - runTime: { median: false }, - waitTime: { median: false }, - elu: { median: false }, - weights: expect.objectContaining({ - 0: expect.any(Number), - [pool.info.maxSize - 1]: expect.any(Number) - }) - }) await pool.destroy() } }) @@ -169,25 +143,6 @@ describe('Selection strategies test suite', () => { await pool.destroy() }) - it('Verify strategies wait for worker node readiness in dynamic pool', async () => { - const pool = new DynamicThreadPool( - min, - max, - './tests/worker-files/thread/testWorker.mjs' - ) - expect(pool.starting).toBe(false) - expect(pool.workerNodes.length).toBe(min) - const maxMultiplier = 10000 - const promises = new Set() - for (let i = 0; i < max * maxMultiplier; i++) { - promises.add(pool.execute()) - } - await Promise.all(promises) - expect(pool.workerNodes.length).toBe(max) - // We need to clean up the resources after our test - await pool.destroy() - }) - it('Verify ROUND_ROBIN strategy default policy', async () => { const workerChoiceStrategy = WorkerChoiceStrategies.ROUND_ROBIN let pool = new FixedThreadPool(