expect(pool.opts.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)
- expect(
- pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .previousWorkerIndex
- ).toBe(0)
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
.currentWorkerIndex
max,
'./tests/worker-files/thread/testWorker.js'
)
- expect(
- pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .previousWorkerIndex
- ).toBeUndefined()
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
.currentWorkerIndex
.workersTaskRunTime
).toBeUndefined()
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
- expect(
- pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .previousWorkerIndex
- ).toBe(0)
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
.currentWorkerIndex
max,
'./tests/worker-files/thread/testWorker.js'
)
- expect(
- pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .workerChoiceStrategy.previousWorkerIndex
- ).toBeUndefined()
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
.workerChoiceStrategy.currentWorkerIndex
.workerChoiceStrategy.workersTaskRunTime
).toBeUndefined()
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
- expect(
- pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .workerChoiceStrategy.previousWorkerIndex
- ).toBe(0)
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
.workerChoiceStrategy.currentWorkerIndex