+ expect(longRunningPool.workerNodes.length).toBe(min)
+ for (let i = 0; i < max * 2; i++) {
+ longRunningPool.execute()
+ }
+ expect(longRunningPool.workerNodes.length).toBe(max)
+ await waitWorkerEvents(longRunningPool, 'exit', max - min)
+ expect(longRunningPool.workerNodes.length).toBe(min)
+ expect(
+ longRunningPool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+ longRunningPool.workerChoiceStrategyContext.workerChoiceStrategy
+ ).nextWorkerNodeKey
+ ).toBeLessThan(longRunningPool.workerNodes.length)
+ // We need to clean up the resources after our test
+ await longRunningPool.destroy()