test: add tasks queuing tests
[poolifier.git] / tests / pools / thread / dynamic.test.js
index feb4955d9a9951fbd2dc341028acb76bc638c661..11d91128f3dc2716ae3901b21a132e3aa10996dc 100644 (file)
@@ -100,6 +100,11 @@ describe('Dynamic thread 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()
   })