X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fpools%2Fselection-strategies%2Fworker-choice-strategy-context.test.js;h=63e58d57ed3a9bec4ce6d92c61283379385f2a04;hb=bde3557b4daaacaea222926c3ac6934dcb90fdaa;hp=2070f8e03301aca85ac8215c52e96e11bb065acd;hpb=230fcf18603f74badb3446048ed9feaf24afa54a;p=poolifier.git diff --git a/tests/pools/selection-strategies/worker-choice-strategy-context.test.js b/tests/pools/selection-strategies/worker-choice-strategy-context.test.js index 2070f8e0..63e58d57 100644 --- a/tests/pools/selection-strategies/worker-choice-strategy-context.test.js +++ b/tests/pools/selection-strategies/worker-choice-strategy-context.test.js @@ -91,7 +91,7 @@ describe('Worker choice strategy context test suite', () => { 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 ) @@ -115,14 +115,18 @@ describe('Worker choice strategy context test suite', () => { WorkerChoiceStrategyUndefinedStub ) expect(() => workerChoiceStrategyContext.execute()).toThrowError( - new Error('Worker node key chosen is null or undefined') + new TypeError( + '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 TypeError( + 'Worker node key chosen is null or undefined after 6 retries' + ) ) })