fix: ensure worker choice is retried at least the pool max size
[poolifier.git] / tests / pools / selection-strategies / worker-choice-strategy-context.test.mjs
index 96281a9563bf853d207156984fdf9f2938579213..f076f4ddda866dc79735530a8ec4003202dee772 100644 (file)
@@ -95,7 +95,9 @@ describe('Worker choice strategy context test suite', () => {
       workerChoiceStrategyUndefinedStub
     )
     expect(() => workerChoiceStrategyContext.execute()).toThrow(
-      new Error('Worker node key chosen is null or undefined after 6 retries')
+      new Error(
+        `Worker node key chosen is null or undefined after ${fixedPool.info.maxSize} retries`
+      )
     )
     const workerChoiceStrategyNullStub = createStubInstance(
       RoundRobinWorkerChoiceStrategy,
@@ -109,7 +111,9 @@ describe('Worker choice strategy context test suite', () => {
       workerChoiceStrategyNullStub
     )
     expect(() => workerChoiceStrategyContext.execute()).toThrow(
-      new Error('Worker node key chosen is null or undefined after 6 retries')
+      new Error(
+        `Worker node key chosen is null or undefined after ${fixedPool.info.maxSize} retries`
+      )
     )
   })