})
for (const [, workerChoiceStrategy] of pool.workerChoiceStrategyContext
.workerChoiceStrategies) {
- expect(workerChoiceStrategy.opts).toStrictEqual(
- expect.objectContaining({
- retries:
- pool.info.maxSize +
- Object.keys(workerChoiceStrategy.opts.weights).length,
- runTime: { median: false },
- waitTime: { median: false },
- elu: { median: false }
+ expect(workerChoiceStrategy.opts).toStrictEqual({
+ retries:
+ pool.info.maxSize +
+ Object.keys(workerChoiceStrategy.opts.weights).length,
+ runTime: { median: false },
+ waitTime: { median: false },
+ elu: { median: false },
+ weights: expect.objectContaining({
+ 0: expect.any(Number),
+ [pool.info.maxSize - 1]: expect.any(Number)
})
- )
+ })
}
await pool.destroy()
const testHandler = () => console.info('test handler executed')
})
for (const [, workerChoiceStrategy] of pool.workerChoiceStrategyContext
.workerChoiceStrategies) {
- expect(workerChoiceStrategy.opts).toStrictEqual(
- expect.objectContaining({
- retries:
- pool.info.maxSize +
- Object.keys(workerChoiceStrategy.opts.weights).length,
- runTime: { median: false },
- waitTime: { median: false },
- elu: { median: false }
+ expect(workerChoiceStrategy.opts).toStrictEqual({
+ retries:
+ pool.info.maxSize +
+ Object.keys(workerChoiceStrategy.opts.weights).length,
+ runTime: { median: false },
+ waitTime: { median: false },
+ elu: { median: false },
+ weights: expect.objectContaining({
+ 0: expect.any(Number),
+ [pool.info.maxSize - 1]: expect.any(Number)
})
- )
+ })
}
expect(
pool.workerChoiceStrategyContext.getTaskStatisticsRequirements()
})
for (const [, workerChoiceStrategy] of pool.workerChoiceStrategyContext
.workerChoiceStrategies) {
- expect(workerChoiceStrategy.opts).toStrictEqual(
- expect.objectContaining({
- retries:
- pool.info.maxSize +
- Object.keys(workerChoiceStrategy.opts.weights).length,
- runTime: { median: true },
- waitTime: { median: false },
- elu: { median: true }
+ expect(workerChoiceStrategy.opts).toStrictEqual({
+ retries:
+ pool.info.maxSize +
+ Object.keys(workerChoiceStrategy.opts.weights).length,
+ runTime: { median: true },
+ waitTime: { median: false },
+ elu: { median: true },
+ weights: expect.objectContaining({
+ 0: expect.any(Number),
+ [pool.info.maxSize - 1]: expect.any(Number)
})
- )
+ })
}
expect(
pool.workerChoiceStrategyContext.getTaskStatisticsRequirements()
})
for (const [, workerChoiceStrategy] of pool.workerChoiceStrategyContext
.workerChoiceStrategies) {
- expect(workerChoiceStrategy.opts).toStrictEqual(
- expect.objectContaining({
- retries:
- pool.info.maxSize +
- Object.keys(workerChoiceStrategy.opts.weights).length,
- runTime: { median: false },
- waitTime: { median: false },
- elu: { median: false }
+ expect(workerChoiceStrategy.opts).toStrictEqual({
+ retries:
+ pool.info.maxSize +
+ Object.keys(workerChoiceStrategy.opts.weights).length,
+ runTime: { median: false },
+ waitTime: { median: false },
+ elu: { median: false },
+ weights: expect.objectContaining({
+ 0: expect.any(Number),
+ [pool.info.maxSize - 1]: expect.any(Number)
})
- )
+ })
}
expect(
pool.workerChoiceStrategyContext.getTaskStatisticsRequirements()