expect(pool.opts.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.ROUND_ROBIN
)
+ expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
+ WorkerChoiceStrategies.ROUND_ROBIN
+ )
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).nextWorkerNodeId
).toBe(0)
// We need to clean up the resources after our test
expect(pool.opts.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.ROUND_ROBIN
)
+ expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
+ WorkerChoiceStrategies.ROUND_ROBIN
+ )
// We need to clean up the resources after our test
await pool.destroy()
})
it('Verify ROUND_ROBIN strategy default tasks usage statistics requirements', async () => {
let pool = new FixedThreadPool(
max,
- './tests/worker-files/thread/testWorker.js'
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.ROUND_ROBIN }
)
- pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.ROUND_ROBIN)
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(false)
pool = new DynamicThreadPool(
min,
max,
- './tests/worker-files/thread/testWorker.js'
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.ROUND_ROBIN }
)
- pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.ROUND_ROBIN)
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(false)
'./tests/worker-files/thread/testWorker.js',
{ workerChoiceStrategy: WorkerChoiceStrategies.ROUND_ROBIN }
)
- expect(pool.opts.workerChoiceStrategy).toBe(
- WorkerChoiceStrategies.ROUND_ROBIN
- )
// TODO: Create a better test to cover `RoundRobinWorkerChoiceStrategy#choose`
const promises = []
for (let i = 0; i < max * 2; i++) {
'./tests/worker-files/thread/testWorker.js',
{ workerChoiceStrategy: WorkerChoiceStrategies.ROUND_ROBIN }
)
- expect(pool.opts.workerChoiceStrategy).toBe(
- WorkerChoiceStrategies.ROUND_ROBIN
- )
// TODO: Create a better test to cover `RoundRobinWorkerChoiceStrategy#choose`
const promises = []
for (let i = 0; i < max * 2; i++) {
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.ROUND_ROBIN)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).nextWorkerNodeId
).toBe(0)
await pool.destroy()
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.ROUND_ROBIN)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).nextWorkerNodeId
).toBe(0)
// We need to clean up the resources after our test
expect(pool.opts.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.LESS_USED
)
+ expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
+ WorkerChoiceStrategies.LESS_USED
+ )
// We need to clean up the resources after our test
await pool.destroy()
})
expect(pool.opts.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.LESS_USED
)
+ expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
+ WorkerChoiceStrategies.LESS_USED
+ )
// We need to clean up the resources after our test
await pool.destroy()
})
it('Verify LESS_USED strategy default tasks usage statistics requirements', async () => {
let pool = new FixedThreadPool(
max,
- './tests/worker-files/thread/testWorker.js'
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
)
- pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.LESS_USED)
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(false)
pool = new DynamicThreadPool(
min,
max,
- './tests/worker-files/thread/testWorker.js'
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
)
- pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.LESS_USED)
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(false)
expect(pool.opts.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.LESS_BUSY
)
+ expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
+ WorkerChoiceStrategies.LESS_BUSY
+ )
// We need to clean up the resources after our test
await pool.destroy()
})
expect(pool.opts.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.LESS_BUSY
)
+ expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
+ WorkerChoiceStrategies.LESS_BUSY
+ )
// We need to clean up the resources after our test
await pool.destroy()
})
it('Verify LESS_BUSY strategy default tasks usage statistics requirements', async () => {
let pool = new FixedThreadPool(
max,
- './tests/worker-files/thread/testWorker.js'
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY }
)
- pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.LESS_BUSY)
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
pool = new DynamicThreadPool(
min,
max,
- './tests/worker-files/thread/testWorker.js'
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY }
)
- pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.LESS_BUSY)
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
expect(pool.opts.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.FAIR_SHARE
)
+ expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
+ WorkerChoiceStrategies.FAIR_SHARE
+ )
for (const workerNodeKey of pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.FAIR_SHARE)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workerLastVirtualTaskTimestamp.keys()) {
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.FAIR_SHARE)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workerLastVirtualTaskTimestamp.get(workerNodeKey).start
).toBe(0)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.FAIR_SHARE)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workerLastVirtualTaskTimestamp.get(workerNodeKey).end
).toBe(0)
}
expect(pool.opts.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.FAIR_SHARE
)
+ expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
+ WorkerChoiceStrategies.FAIR_SHARE
+ )
// We need to clean up the resources after our test
await pool.destroy()
})
it('Verify FAIR_SHARE strategy default tasks usage statistics requirements', async () => {
let pool = new FixedThreadPool(
max,
- './tests/worker-files/thread/testWorker.js'
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.FAIR_SHARE }
)
- pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.FAIR_SHARE)
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
pool = new DynamicThreadPool(
min,
max,
- './tests/worker-files/thread/testWorker.js'
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.FAIR_SHARE }
)
- pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.FAIR_SHARE)
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
await Promise.all(promises)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.FAIR_SHARE
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).workerLastVirtualTaskTimestamp.size
).toBe(pool.workerNodes.length)
// We need to clean up the resources after our test
// if (process.platform !== 'win32') {
// expect(
// pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- // WorkerChoiceStrategies.FAIR_SHARE
+ // pool.workerChoiceStrategyContext.workerChoiceStrategy
// ).workerLastVirtualTaskTimestamp.size
// ).toBe(pool.workerNodes.length)
// }
).toBeDefined()
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.FAIR_SHARE)
for (const workerNodeKey of pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.FAIR_SHARE)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workerLastVirtualTaskTimestamp.keys()) {
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.FAIR_SHARE)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workerLastVirtualTaskTimestamp.get(workerNodeKey).start
).toBe(0)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.FAIR_SHARE)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workerLastVirtualTaskTimestamp.get(workerNodeKey).end
).toBe(0)
}
).toBeDefined()
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.FAIR_SHARE)
for (const workerNodeKey of pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.FAIR_SHARE)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workerLastVirtualTaskTimestamp.keys()) {
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.FAIR_SHARE)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workerLastVirtualTaskTimestamp.get(workerNodeKey).start
).toBe(0)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.FAIR_SHARE)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workerLastVirtualTaskTimestamp.get(workerNodeKey).end
).toBe(0)
}
expect(pool.opts.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)
+ expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
+ WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ )
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).currentWorkerNodeId
).toBe(0)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).defaultWorkerWeight
).toBeGreaterThan(0)
for (const workerNodeKey of pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workersTaskRunTime.keys()) {
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workersTaskRunTime.get(workerNodeKey).weight
).toBeGreaterThan(0)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workersTaskRunTime.get(workerNodeKey).runTime
).toBe(0)
}
expect(pool.opts.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)
+ expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
+ WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ )
// We need to clean up the resources after our test
await pool.destroy()
})
it('Verify WEIGHTED_ROUND_ROBIN strategy default tasks usage statistics requirements', async () => {
let pool = new FixedThreadPool(
max,
- './tests/worker-files/thread/testWorker.js'
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN }
)
- pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
pool = new DynamicThreadPool(
min,
max,
- './tests/worker-files/thread/testWorker.js'
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN }
)
- pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
expect(
pool.workerChoiceStrategyContext.getRequiredStatistics().runTime
).toBe(true)
await Promise.all(promises)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).workersTaskRunTime.size
).toBe(pool.workerNodes.length)
// We need to clean up the resources after our test
const promises = []
const maxMultiplier =
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).defaultWorkerWeight * 50
for (let i = 0; i < max * maxMultiplier; i++) {
promises.push(pool.execute())
if (process.platform !== 'win32') {
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).workersTaskRunTime.size
).toBe(pool.workerNodes.length)
}
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).currentWorkerNodeId
).toBe(0)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).defaultWorkerWeight
).toBeGreaterThan(0)
for (const workerNodeKey of pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workersTaskRunTime.keys()) {
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workersTaskRunTime.get(workerNodeKey).runTime
).toBe(0)
}
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).currentWorkerNodeId
).toBe(0)
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
- WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ pool.workerChoiceStrategyContext.workerChoiceStrategy
).defaultWorkerWeight
).toBeGreaterThan(0)
for (const workerNodeKey of pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workersTaskRunTime.keys()) {
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies
- .get(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
+ .get(pool.workerChoiceStrategyContext.workerChoiceStrategy)
.workersTaskRunTime.get(workerNodeKey).runTime
).toBe(0)
}
choose: sinon.stub().returns(0)
}
)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.ROUND_ROBIN
)
workerChoiceStrategyContext.workerChoiceStrategies.set(
- workerChoiceStrategyContext.workerChoiceStrategyType,
+ workerChoiceStrategyContext.workerChoiceStrategy,
WorkerChoiceStrategyStub
)
const chosenWorkerKey = workerChoiceStrategyContext.execute()
expect(
workerChoiceStrategyContext.workerChoiceStrategies.get(
- workerChoiceStrategyContext.workerChoiceStrategyType
+ workerChoiceStrategyContext.workerChoiceStrategy
).choose.calledOnce
).toBe(true)
expect(chosenWorkerKey).toBe(0)
choose: sinon.stub().returns(0)
}
)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.ROUND_ROBIN
)
workerChoiceStrategyContext.workerChoiceStrategies.set(
- workerChoiceStrategyContext.workerChoiceStrategyType,
+ workerChoiceStrategyContext.workerChoiceStrategy,
WorkerChoiceStrategyStub
)
const chosenWorkerKey = workerChoiceStrategyContext.execute()
expect(
workerChoiceStrategyContext.workerChoiceStrategies.get(
- workerChoiceStrategyContext.workerChoiceStrategyType
+ workerChoiceStrategyContext.workerChoiceStrategy
).choose.calledOnce
).toBe(true)
expect(chosenWorkerKey).toBe(0)
WorkerChoiceStrategies.ROUND_ROBIN
)
).toBeInstanceOf(RoundRobinWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.ROUND_ROBIN
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
WorkerChoiceStrategies.ROUND_ROBIN
)
).toBeInstanceOf(RoundRobinWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.ROUND_ROBIN
)
})
WorkerChoiceStrategies.ROUND_ROBIN
)
).toBeInstanceOf(RoundRobinWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.ROUND_ROBIN
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
WorkerChoiceStrategies.ROUND_ROBIN
)
).toBeInstanceOf(RoundRobinWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.ROUND_ROBIN
)
})
WorkerChoiceStrategies.LESS_USED
)
).toBeInstanceOf(LessUsedWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.LESS_USED
)
})
WorkerChoiceStrategies.LESS_USED
)
).toBeInstanceOf(LessUsedWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.LESS_USED
)
})
WorkerChoiceStrategies.LESS_BUSY
)
).toBeInstanceOf(LessBusyWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.LESS_BUSY
)
})
WorkerChoiceStrategies.LESS_BUSY
)
).toBeInstanceOf(LessBusyWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.LESS_BUSY
)
})
WorkerChoiceStrategies.FAIR_SHARE
)
).toBeInstanceOf(FairShareWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.FAIR_SHARE
)
})
WorkerChoiceStrategies.FAIR_SHARE
)
).toBeInstanceOf(FairShareWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.FAIR_SHARE
)
})
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)
).toBeInstanceOf(WeightedRoundRobinWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)
})
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)
).toBeInstanceOf(WeightedRoundRobinWorkerChoiceStrategy)
- expect(workerChoiceStrategyContext.workerChoiceStrategyType).toBe(
+ expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)
})