expect(chosenWorkerKey).toBe(0)
})
- it('Verify that execute() throws error if null or undefined is returned', () => {
+ it('Verify that execute() throws error if null or undefined is returned after retries', () => {
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
fixedPool
)
WorkerChoiceStrategyUndefinedStub
)
expect(() => workerChoiceStrategyContext.execute()).toThrowError(
- new Error('Worker node key chosen is null or undefined')
+ new Error('Worker node key chosen is null or undefined after 6 retries')
)
workerChoiceStrategyContext.workerChoiceStrategies.set(
workerChoiceStrategyContext.workerChoiceStrategy,
WorkerChoiceStrategyNullStub
)
expect(() => workerChoiceStrategyContext.execute()).toThrowError(
- new Error('Worker node key chosen is null or undefined')
+ new Error('Worker node key chosen is null or undefined after 6 retries')
)
})