docs: update benchmarks vs. external pools
[poolifier.git] / tests / pools / cluster / dynamic.test.js
index 33a5ab8c013bac7bb4d114fa4dda0c9cfff1153b..23403ab78108620f555d8d9d8635cb06bcafd1e8 100644 (file)
@@ -66,7 +66,7 @@ describe('Dynamic cluster pool test suite', () => {
 
   it('Validation of inputs test', () => {
     expect(() => new DynamicClusterPool(min)).toThrowError(
-      new Error('Please specify a file with a worker implementation')
+      'Please specify a file with a worker implementation'
     )
   })
 
@@ -100,6 +100,11 @@ describe('Dynamic cluster pool test suite', () => {
     expect(longRunningPool.workerNodes.length).toBe(max)
     await TestUtils.waitExits(longRunningPool, max - min)
     expect(longRunningPool.workerNodes.length).toBe(min)
+    expect(
+      longRunningPool.workerChoiceStrategyContext.workerChoiceStrategies.get(
+        longRunningPool.workerChoiceStrategyContext.workerChoiceStrategy
+      ).nextWorkerNodeId
+    ).toBeLessThan(longRunningPool.workerNodes.length)
     // We need to clean up the resources after our test
     await longRunningPool.destroy()
   })