+ it('Verify that setWorkerChoiceStrategy() works with LESS_USED and fixed pool', () => {
+ const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
+ fixedPool
+ )
+ workerChoiceStrategyContext.setWorkerChoiceStrategy(
+ WorkerChoiceStrategies.LESS_USED
+ )
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBeInstanceOf(
+ LessUsedWorkerChoiceStrategy
+ )
+ })
+
+ it('Verify that setWorkerChoiceStrategy() works with LESS_USED and dynamic pool', () => {
+ const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
+ dynamicPool
+ )
+ workerChoiceStrategyContext.setWorkerChoiceStrategy(
+ WorkerChoiceStrategies.LESS_USED
+ )
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBeInstanceOf(
+ DynamicPoolWorkerChoiceStrategy
+ )
+ expect(
+ workerChoiceStrategyContext.workerChoiceStrategy.workerChoiceStrategy
+ ).toBeInstanceOf(LessUsedWorkerChoiceStrategy)
+ })
+
+ it('Verify that setWorkerChoiceStrategy() works with LESS_BUSY and fixed pool', () => {