X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fpools%2Fselection-strategies%2Fselection-strategies.test.mjs;h=200e83c7c83af1eaca13ec86e62efee724402d3b;hb=af7f2788b6fcc39343d544551cf17c8f0dc5b757;hp=127377a26118c5d5be57cf98661eb9139fe5d81f;hpb=722d55a0b7bdb6b03cc523e5debef6b612c332f8;p=poolifier.git diff --git a/tests/pools/selection-strategies/selection-strategies.test.mjs b/tests/pools/selection-strategies/selection-strategies.test.mjs index 127377a2..200e83c7 100644 --- a/tests/pools/selection-strategies/selection-strategies.test.mjs +++ b/tests/pools/selection-strategies/selection-strategies.test.mjs @@ -7,7 +7,6 @@ import { WorkerChoiceStrategies } from '../../../lib/index.js' import { CircularArray } from '../../../lib/circular-array.js' -import { sleep } from '../../test-utils.js' describe('Selection strategies test suite', () => { const min = 0 @@ -67,14 +66,9 @@ describe('Selection strategies test suite', () => { expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe( workerChoiceStrategy ) - expect(pool.opts.workerChoiceStrategyOptions).toStrictEqual({ - retries: 6, - runTime: { median: false }, - waitTime: { median: false }, - elu: { median: false } - }) + expect(pool.opts.workerChoiceStrategyOptions).toBeUndefined() expect(pool.workerChoiceStrategyContext.opts).toStrictEqual({ - retries: 6, + retries: pool.info.maxSize, runTime: { median: false }, waitTime: { median: false }, elu: { median: false } @@ -87,19 +81,14 @@ describe('Selection strategies test suite', () => { max, './tests/worker-files/cluster/testWorker.js' ) - pool.setWorkerChoiceStrategy(workerChoiceStrategy, { retries: 3 }) + pool.setWorkerChoiceStrategy(workerChoiceStrategy) expect(pool.opts.workerChoiceStrategy).toBe(workerChoiceStrategy) expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe( workerChoiceStrategy ) - expect(pool.opts.workerChoiceStrategyOptions).toStrictEqual({ - retries: 3, - runTime: { median: false }, - waitTime: { median: false }, - elu: { median: false } - }) + expect(pool.opts.workerChoiceStrategyOptions).toBeUndefined() expect(pool.workerChoiceStrategyContext.opts).toStrictEqual({ - retries: 3, + retries: pool.info.maxSize, runTime: { median: false }, waitTime: { median: false }, elu: { median: false } @@ -181,7 +170,6 @@ describe('Selection strategies test suite', () => { max, './tests/worker-files/thread/testWorker.mjs' ) - await sleep(600) expect(pool.starting).toBe(false) expect(pool.workerNodes.length).toBe(min) const maxMultiplier = 10000