promises.push(pool.execute())
}
await Promise.all(promises)
- if (process.platform !== 'win32') {
- expect(
- pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- pool.workerChoiceStrategyContext.workerChoiceStrategy
- ).workersVirtualTaskTimestamp.length
- ).toBe(pool.workerNodes.length)
- }
+ expect(
+ pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
+ ).workersVirtualTaskTimestamp.length
+ ).toBe(pool.workerNodes.length)
// We need to clean up the resources after our test
await pool.destroy()
})
expect(workerNode.tasksUsage.medRunTime).toBeDefined()
expect(workerNode.tasksUsage.medRunTime).toBeGreaterThan(0)
}
- if (process.platform !== 'win32') {
- expect(
- pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- pool.workerChoiceStrategyContext.workerChoiceStrategy
- ).workersVirtualTaskTimestamp.length
- ).toBe(pool.workerNodes.length)
- }
+ expect(
+ pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
+ ).workersVirtualTaskTimestamp.length
+ ).toBe(pool.workerNodes.length)
// We need to clean up the resources after our test
await pool.destroy()
})
workerChoiceStrategy
).workersVirtualTaskTimestamp.length
).toBe(0)
+ pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+ workerChoiceStrategy
+ ).workersVirtualTaskTimestamp[0] = 0
+ expect(
+ pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+ workerChoiceStrategy
+ ).workersVirtualTaskTimestamp.length
+ ).toBe(1)
pool.setWorkerChoiceStrategy(workerChoiceStrategy)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
workerChoiceStrategy
).workersVirtualTaskTimestamp
).toBeInstanceOf(Array)
- pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- workerChoiceStrategy
- ).workersVirtualTaskTimestamp[0] = 0
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
workerChoiceStrategy
).workersVirtualTaskTimestamp.length
- ).toBe(1)
+ ).toBe(0)
await pool.destroy()
pool = new DynamicThreadPool(
min,
workerChoiceStrategy
).workersVirtualTaskTimestamp
).toBeInstanceOf(Array)
+ expect(
+ pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+ workerChoiceStrategy
+ ).workersVirtualTaskTimestamp.length
+ ).toBe(0)
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
workerChoiceStrategy
).workersVirtualTaskTimestamp[0] = 0
promises.push(pool.execute())
}
await Promise.all(promises)
- if (process.platform !== 'win32') {
- expect(
- pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- pool.workerChoiceStrategyContext.workerChoiceStrategy
- ).defaultWorkerWeight
- ).toBeGreaterThan(0)
- expect(
- pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- pool.workerChoiceStrategyContext.workerChoiceStrategy
- ).workerVirtualTaskRunTime
- ).toBeGreaterThanOrEqual(0)
- }
+ expect(
+ pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
+ ).defaultWorkerWeight
+ ).toBeGreaterThan(0)
+ expect(
+ pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
+ ).workerVirtualTaskRunTime
+ ).toBeGreaterThanOrEqual(0)
// We need to clean up the resources after our test
await pool.destroy()
})