test: add missing pool destroy() calls
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 27 Aug 2023 15:14:28 +0000 (17:14 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 27 Aug 2023 15:14:28 +0000 (17:14 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
tests/pools/abstract/abstract-pool.test.js

index 945ee8e7acf6417b2e6816e87bce1dffce48265d..75b0a35c288735450f0650bb81a88e22e639036d 100644 (file)
@@ -154,22 +154,22 @@ describe('Abstract pool test suite', () => {
     )
     expect(
       () =>
-        new DynamicClusterPool(
-          1,
-          1,
-          './tests/worker-files/cluster/testWorker.js'
-        )
+        new DynamicThreadPool(0, 0, './tests/worker-files/thread/testWorker.js')
     ).toThrowError(
       new RangeError(
-        'Cannot instantiate a dynamic pool with a minimum pool size equal to the maximum pool size. Use a fixed pool instead'
+        'Cannot instantiate a dynamic pool with a maximum pool size equal to zero'
       )
     )
     expect(
       () =>
-        new DynamicThreadPool(0, 0, './tests/worker-files/thread/testWorker.js')
+        new DynamicClusterPool(
+          1,
+          1,
+          './tests/worker-files/cluster/testWorker.js'
+        )
     ).toThrowError(
       new RangeError(
-        'Cannot instantiate a dynamic pool with a maximum pool size equal to zero'
+        'Cannot instantiate a dynamic pool with a minimum pool size equal to the maximum pool size. Use a fixed pool instead'
       )
     )
   })
@@ -799,6 +799,7 @@ describe('Abstract pool test suite', () => {
       expect(workerNode.tasksQueue.size).toBe(0)
       expect(workerNode.tasksQueue.maxSize).toBe(0)
     }
+    await pool.destroy()
   })
 
   it('Verify that pool worker info are initialized', async () => {
@@ -828,6 +829,7 @@ describe('Abstract pool test suite', () => {
         ready: true
       })
     }
+    await pool.destroy()
   })
 
   it('Verify that pool execute() arguments are checked', async () => {