From: Jérôme Benoit Date: Mon, 11 Dec 2023 18:09:39 +0000 (+0100) Subject: test: destroy pool in async context tracking test X-Git-Tag: v3.0.11~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8954c0a3cd5941d5c86f40eb627ae681770fade7;p=poolifier.git test: destroy pool in async context tracking test Signed-off-by: Jérôme Benoit --- diff --git a/tests/pools/abstract-pool.test.mjs b/tests/pools/abstract-pool.test.mjs index ec4ffabc..edf03f4a 100644 --- a/tests/pools/abstract-pool.test.mjs +++ b/tests/pools/abstract-pool.test.mjs @@ -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 () => {