test: destroy pool in async context tracking test
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 11 Dec 2023 18:09:39 +0000 (19:09 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 11 Dec 2023 18:09:39 +0000 (19:09 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
tests/pools/abstract-pool.test.mjs

index ec4ffabcdbbe77a694ec652ca59b4e00ec298670..edf03f4ae327b4f7c79fe9a1a9c9917c91de6e19 100644 (file)
@@ -1291,17 +1291,18 @@ describe('Abstract pool test suite', () => {
         if (executionAsyncId() === taskAsyncId) resolveCalls++
       }
     })
-    hook.enable()
     const pool = new FixedThreadPool(
       numberOfWorkers,
       './tests/worker-files/thread/testWorker.mjs'
     )
+    hook.enable()
     await pool.execute()
     hook.disable()
     expect(initCalls).toBe(1)
     expect(beforeCalls).toBe(1)
     expect(afterCalls).toBe(1)
     expect(resolveCalls).toBe(1)
+    await pool.destroy()
   })
 
   it('Verify that hasTaskFunction() is working', async () => {