+ it('Verify that setWorkerChoiceStrategy() works with LESS_USED and fixed pool', () => {
+ const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
+ fixedPool
+ )
+ workerChoiceStrategyContext.setWorkerChoiceStrategy(
+ WorkerChoiceStrategies.LESS_USED
+ )
+ expect(
+ workerChoiceStrategyContext.getWorkerChoiceStrategy()
+ ).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.getWorkerChoiceStrategy()
+ ).toBeInstanceOf(DynamicPoolWorkerChoiceStrategy)
+ expect(
+ workerChoiceStrategyContext.getWorkerChoiceStrategy().workerChoiceStrategy
+ ).toBeInstanceOf(LessUsedWorkerChoiceStrategy)
+ })
+
+ it('Verify that setWorkerChoiceStrategy() works with LESS_BUSY and fixed pool', () => {