numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js'
)
- const promises = []
+ const promises = new Set()
const maxMultiplier = 2
for (let i = 0; i < numberOfWorkers * maxMultiplier; i++) {
- promises.push(pool.execute())
+ promises.add(pool.execute())
}
for (const workerNode of pool.workerNodes) {
expect(workerNode.tasksUsage).toStrictEqual({
numberOfWorkers,
'./tests/worker-files/thread/testWorker.js'
)
- const promises = []
+ const promises = new Set()
const maxMultiplier = 2
for (let i = 0; i < numberOfWorkers * maxMultiplier; i++) {
- promises.push(pool.execute())
+ promises.add(pool.execute())
}
await Promise.all(promises)
for (const workerNode of pool.workerNodes) {
numberOfWorkers,
'./tests/worker-files/thread/testWorker.js'
)
- const promises = []
+ const promises = new Set()
let poolFull = 0
pool.emitter.on(PoolEvents.full, () => ++poolFull)
for (let i = 0; i < numberOfWorkers * 2; i++) {
numberOfWorkers,
'./tests/worker-files/thread/testWorker.js'
)
- const promises = []
+ const promises = new Set()
let poolBusy = 0
pool.emitter.on(PoolEvents.busy, () => ++poolBusy)
for (let i = 0; i < numberOfWorkers * 2; i++) {