- expect(longRunningPool.workers.length).toBe(max)
- await TestUtils.waitExits(longRunningPool, max - min)
- // Here we expect the workers to be at the max size since that the task is still running
- expect(longRunningPool.workers.length).toBe(min)
+ expect(longRunningPool.workerNodes.length).toBe(max)
+ await TestUtils.waitWorkerEvents(longRunningPool, 'exit', max - min)
+ expect(longRunningPool.workerNodes.length).toBe(min)
+ expect(
+ longRunningPool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+ longRunningPool.workerChoiceStrategyContext.workerChoiceStrategy
+ ).nextWorkerNodeId
+ ).toBeLessThan(longRunningPool.workerNodes.length)