}
await Promise.all(promises)
for (const workerNode of pool.workerNodes) {
- expect(workerNode.usage).toMatchObject({
+ expect(workerNode.usage).toStrictEqual({
tasks: {
executed: expect.any(Number),
executing: 0,
stolen: 0,
failed: 0
},
- runTime: {
+ runTime: expect.objectContaining({
history: expect.any(CircularArray)
- },
- waitTime: {
+ }),
+ waitTime: expect.objectContaining({
history: expect.any(CircularArray)
- },
+ }),
elu: {
idle: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
active: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
}
}
})
}
await Promise.all(promises)
for (const workerNode of pool.workerNodes) {
- expect(workerNode.usage).toMatchObject({
+ expect(workerNode.usage).toStrictEqual({
tasks: {
executed: expect.any(Number),
executing: 0,
stolen: 0,
failed: 0
},
- runTime: {
+ runTime: expect.objectContaining({
history: expect.any(CircularArray)
- },
- waitTime: {
+ }),
+ waitTime: expect.objectContaining({
history: expect.any(CircularArray)
- },
+ }),
elu: {
idle: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
active: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
}
}
})
}
await Promise.all(promises)
for (const workerNode of pool.workerNodes) {
- expect(workerNode.usage).toMatchObject({
+ expect(workerNode.usage).toStrictEqual({
tasks: {
executed: expect.any(Number),
executing: 0,
failed: 0
},
runTime: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
waitTime: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
- elu: {
- idle: {
+ elu: expect.objectContaining({
+ idle: expect.objectContaining({
history: expect.any(CircularArray)
- },
- active: {
+ }),
+ active: expect.objectContaining({
history: expect.any(CircularArray)
- }
- }
+ })
+ })
})
expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
}
await Promise.all(promises)
for (const workerNode of pool.workerNodes) {
- expect(workerNode.usage).toMatchObject({
+ expect(workerNode.usage).toStrictEqual({
tasks: {
executed: expect.any(Number),
executing: 0,
failed: 0
},
runTime: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
waitTime: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
- elu: {
- idle: {
+ elu: expect.objectContaining({
+ idle: expect.objectContaining({
history: expect.any(CircularArray)
- },
- active: {
+ }),
+ active: expect.objectContaining({
history: expect.any(CircularArray)
- }
- }
+ })
+ })
})
expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
}
await Promise.all(promises)
for (const workerNode of pool.workerNodes) {
- expect(workerNode.usage).toMatchObject({
+ expect(workerNode.usage).toStrictEqual({
tasks: {
executed: expect.any(Number),
executing: 0,
stolen: 0,
failed: 0
},
- runTime: {
+ runTime: expect.objectContaining({
history: expect.any(CircularArray)
- },
+ }),
waitTime: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
- elu: {
- idle: {
+ elu: expect.objectContaining({
+ idle: expect.objectContaining({
history: expect.any(CircularArray)
- },
- active: {
+ }),
+ active: expect.objectContaining({
history: expect.any(CircularArray)
- }
- }
+ })
+ })
})
expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
}
await Promise.all(promises)
for (const workerNode of pool.workerNodes) {
- expect(workerNode.usage).toMatchObject({
+ expect(workerNode.usage).toStrictEqual({
tasks: {
executed: expect.any(Number),
executing: 0,
stolen: 0,
failed: 0
},
- runTime: {
+ runTime: expect.objectContaining({
history: expect.any(CircularArray)
- },
+ }),
waitTime: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
- elu: {
- idle: {
+ elu: expect.objectContaining({
+ idle: expect.objectContaining({
history: expect.any(CircularArray)
- },
- active: {
+ }),
+ active: expect.objectContaining({
history: expect.any(CircularArray)
- }
- }
+ })
+ })
})
expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
}
await Promise.all(promises)
for (const workerNode of pool.workerNodes) {
- expect(workerNode.usage).toMatchObject({
+ expect(workerNode.usage).toStrictEqual({
tasks: {
executed: expect.any(Number),
executing: 0,
stolen: 0,
failed: 0
},
- runTime: {
+ runTime: expect.objectContaining({
history: expect.any(CircularArray)
- },
+ }),
waitTime: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
- elu: {
- idle: {
+ elu: expect.objectContaining({
+ idle: expect.objectContaining({
history: expect.any(CircularArray)
- },
- active: {
+ }),
+ active: expect.objectContaining({
history: expect.any(CircularArray)
- }
- }
+ })
+ })
})
expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
history: expect.any(CircularArray)
}),
waitTime: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
elu: {
idle: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
active: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
}
}
})
history: expect.any(CircularArray)
}),
waitTime: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
elu: {
idle: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
active: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
}
}
})
history: expect.any(CircularArray)
}),
waitTime: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
elu: {
idle: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
},
active: {
- history: expect.any(CircularArray)
+ history: new CircularArray()
}
}
})
pool.workerChoiceStrategyContext.getTaskStatisticsRequirements()
).toStrictEqual({
runTime: {
- aggregate: false,
- average: false,
+ aggregate: true,
+ average: true,
median: false
},
waitTime: {
pool.workerChoiceStrategyContext.getTaskStatisticsRequirements()
).toStrictEqual({
runTime: {
- aggregate: false,
- average: false,
+ aggregate: true,
+ average: true,
median: false
},
waitTime: {
for (const workerNode of pool.workerNodes) {
expect(workerNode.usage).toStrictEqual({
tasks: {
- executed: maxMultiplier,
+ executed: expect.any(Number),
executing: 0,
queued: 0,
maxQueued: 0,
stolen: 0,
failed: 0
},
- runTime: {
- history: new CircularArray()
- },
+ runTime: expect.objectContaining({
+ history: expect.any(CircularArray)
+ }),
waitTime: {
history: new CircularArray()
},
}
}
})
+ expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
+ expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
+ max * maxMultiplier
+ )
}
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
pool.workerChoiceStrategyContext.workerChoiceStrategy
).roundId
).toBe(0)
+ expect(
+ pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
+ ).workerNodeId
+ ).toBe(0)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
pool.workerChoiceStrategyContext.workerChoiceStrategy
stolen: 0,
failed: 0
},
- runTime: {
- history: new CircularArray()
- },
+ runTime: expect.objectContaining({
+ history: expect.any(CircularArray)
+ }),
waitTime: {
history: new CircularArray()
},
pool.workerChoiceStrategyContext.workerChoiceStrategy
).roundId
).toBe(0)
+ expect(
+ pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
+ ).workerNodeId
+ ).toBe(0)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
pool.workerChoiceStrategyContext.workerChoiceStrategy