test: add missing pool destroy() calls
[poolifier.git] / tests / pools / abstract / abstract-pool.test.js
index ddb0534f67d4a685cb0b8630d6282fdc217cfc0d..945ee8e7acf6417b2e6816e87bce1dffce48265d 100644 (file)
@@ -12,6 +12,7 @@ const {
 } = require('../../../lib')
 const { CircularArray } = require('../../../lib/circular-array')
 const { Deque } = require('../../../lib/deque')
+const { DEFAULT_TASK_NAME } = require('../../../lib/utils')
 const { version } = require('../../../package.json')
 const { waitPoolEvents } = require('../../test-utils')
 
@@ -1155,7 +1156,7 @@ describe('Abstract pool test suite', () => {
     )
     await waitPoolEvents(dynamicThreadPool, PoolEvents.ready, 1)
     expect(dynamicThreadPool.listTaskFunctions()).toStrictEqual([
-      'default',
+      DEFAULT_TASK_NAME,
       'jsonIntegerSerialization',
       'factorial',
       'fibonacci'
@@ -1166,11 +1167,13 @@ describe('Abstract pool test suite', () => {
     )
     await waitPoolEvents(fixedClusterPool, PoolEvents.ready, 1)
     expect(fixedClusterPool.listTaskFunctions()).toStrictEqual([
-      'default',
+      DEFAULT_TASK_NAME,
       'jsonIntegerSerialization',
       'factorial',
       'fibonacci'
     ])
+    await dynamicThreadPool.destroy()
+    await fixedClusterPool.destroy()
   })
 
   it('Verify that multiple task functions worker is working', async () => {
@@ -1192,7 +1195,7 @@ describe('Abstract pool test suite', () => {
     expect(pool.info.executedTasks).toBe(4)
     for (const workerNode of pool.workerNodes) {
       expect(workerNode.info.taskFunctions).toStrictEqual([
-        'default',
+        DEFAULT_TASK_NAME,
         'jsonIntegerSerialization',
         'factorial',
         'fibonacci'
@@ -1227,5 +1230,6 @@ describe('Abstract pool test suite', () => {
         ).toBeGreaterThanOrEqual(0)
       }
     }
+    await pool.destroy()
   })
 })