await Promise.all(promises)
expect(poolBusy).toBe(1)
expect(poolBusyInfo).toStrictEqual({
- busyWorkerNodes: expect.any(Number),
+ busyWorkerNodes: numberOfWorkers,
defaultStrategy: WorkerChoiceStrategies.ROUND_ROBIN,
executedTasks: expect.any(Number),
executingTasks: expect.any(Number),
failedTasks: expect.any(Number),
- idleWorkerNodes: expect.any(Number),
+ idleWorkerNodes: 0,
maxSize: numberOfWorkers,
minSize: numberOfWorkers,
ready: true,
worker: WorkerTypes.thread,
workerNodes: numberOfWorkers,
})
+ expect(poolBusyEndInfo.busyWorkerNodes).toBeLessThan(numberOfWorkers)
await pool.destroy()
})
expect(poolBackPressure).toBe(1)
expect(poolBackPressureInfo).toStrictEqual({
backPressure: true,
- backPressureWorkerNodes: expect.any(Number),
+ backPressureWorkerNodes: numberOfWorkers,
busyWorkerNodes: expect.any(Number),
defaultStrategy: WorkerChoiceStrategies.ROUND_ROBIN,
executedTasks: expect.any(Number),
worker: WorkerTypes.thread,
workerNodes: numberOfWorkers,
})
+ expect(poolBackPressureEndInfo.backPressureWorkerNodes).toBeLessThan(
+ numberOfWorkers
+ )
await pool.destroy()
})