From 87c65328003f70331a3bed5e7a2b617e2e4d9f3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 10 Oct 2022 18:32:03 +0200 Subject: [PATCH] Verify that the configured worker choice is going to be used when a dynamic pool is busy MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../worker-choice-strategy-context.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/pools/selection-strategies/worker-choice-strategy-context.test.js b/tests/pools/selection-strategies/worker-choice-strategy-context.test.js index ae608fda..c33dad80 100644 --- a/tests/pools/selection-strategies/worker-choice-strategy-context.test.js +++ b/tests/pools/selection-strategies/worker-choice-strategy-context.test.js @@ -108,6 +108,9 @@ describe('Worker choice strategy context test suite', () => { expect(workerChoiceStrategyContext.workerChoiceStrategy).toBeInstanceOf( DynamicPoolWorkerChoiceStrategy ) + expect( + workerChoiceStrategyContext.workerChoiceStrategy.workerChoiceStrategy + ).toBeInstanceOf(RoundRobinWorkerChoiceStrategy) }) it('Verify that setWorkerChoiceStrategy() works with LESS_RECENTLY_USED and fixed pool', () => { @@ -132,6 +135,9 @@ describe('Worker choice strategy context test suite', () => { expect(workerChoiceStrategyContext.workerChoiceStrategy).toBeInstanceOf( DynamicPoolWorkerChoiceStrategy ) + expect( + workerChoiceStrategyContext.workerChoiceStrategy.workerChoiceStrategy + ).toBeInstanceOf(LessRecentlyUsedWorkerChoiceStrategy) }) it('Verify that setWorkerChoiceStrategy() works with FAIR_SHARE and fixed pool', () => { @@ -156,6 +162,9 @@ describe('Worker choice strategy context test suite', () => { expect(workerChoiceStrategyContext.workerChoiceStrategy).toBeInstanceOf( DynamicPoolWorkerChoiceStrategy ) + expect( + workerChoiceStrategyContext.workerChoiceStrategy.workerChoiceStrategy + ).toBeInstanceOf(FairShareWorkerChoiceStrategy) }) it('Verify that setWorkerChoiceStrategy() works with WEIGHTED_ROUND_ROBIN and fixed pool', () => { @@ -180,5 +189,8 @@ describe('Worker choice strategy context test suite', () => { expect(workerChoiceStrategyContext.workerChoiceStrategy).toBeInstanceOf( DynamicPoolWorkerChoiceStrategy ) + expect( + workerChoiceStrategyContext.workerChoiceStrategy.workerChoiceStrategy + ).toBeInstanceOf(WeightedRoundRobinWorkerChoiceStrategy) }) }) -- 2.34.1