From: Jérôme Benoit Date: Sun, 26 Nov 2023 09:46:20 +0000 (+0100) Subject: test: check that event listener are remove at destroy X-Git-Tag: v3.0.9~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=76efd044dab6a7b3e1fd2d336ada3b4672d1235b;p=poolifier.git test: check that event listener are remove at destroy Signed-off-by: Jérôme Benoit --- diff --git a/tests/pools/cluster/dynamic.test.mjs b/tests/pools/cluster/dynamic.test.mjs index 2c542375..93f995fc 100644 --- a/tests/pools/cluster/dynamic.test.mjs +++ b/tests/pools/cluster/dynamic.test.mjs @@ -67,6 +67,7 @@ describe('Dynamic cluster pool test suite', () => { await pool.destroy() const numberOfExitEvents = await exitPromise expect(pool.started).toBe(false) + expect(pool.emitter.eventNames()).toStrictEqual([]) expect(pool.readyEventEmitted).toBe(false) expect(pool.workerNodes.length).toBe(0) expect(numberOfExitEvents).toBe(min) diff --git a/tests/pools/cluster/fixed.test.mjs b/tests/pools/cluster/fixed.test.mjs index a79be4a3..de188a2e 100644 --- a/tests/pools/cluster/fixed.test.mjs +++ b/tests/pools/cluster/fixed.test.mjs @@ -269,6 +269,7 @@ describe('Fixed cluster pool test suite', () => { await pool.destroy() const numberOfExitEvents = await exitPromise expect(pool.started).toBe(false) + expect(pool.emitter.eventNames()).toStrictEqual([]) expect(pool.readyEventEmitted).toBe(false) expect(pool.workerNodes.length).toBe(0) expect(numberOfExitEvents).toBe(numberOfWorkers) diff --git a/tests/pools/thread/dynamic.test.mjs b/tests/pools/thread/dynamic.test.mjs index ec9d51de..bf7f9527 100644 --- a/tests/pools/thread/dynamic.test.mjs +++ b/tests/pools/thread/dynamic.test.mjs @@ -67,6 +67,7 @@ describe('Dynamic thread pool test suite', () => { await pool.destroy() const numberOfExitEvents = await exitPromise expect(pool.started).toBe(false) + expect(pool.emitter.eventNames()).toStrictEqual([]) expect(pool.readyEventEmitted).toBe(false) expect(pool.workerNodes.length).toBe(0) expect(numberOfExitEvents).toBe(min) diff --git a/tests/pools/thread/fixed.test.mjs b/tests/pools/thread/fixed.test.mjs index 6a435ffe..a7c4a48f 100644 --- a/tests/pools/thread/fixed.test.mjs +++ b/tests/pools/thread/fixed.test.mjs @@ -301,6 +301,7 @@ describe('Fixed thread pool test suite', () => { const numberOfExitEvents = await exitPromise expect(pool.started).toBe(false) expect(pool.readyEventEmitted).toBe(false) + expect(pool.emitter.eventNames()).toStrictEqual([]) expect(pool.workerNodes.length).toBe(0) expect(numberOfExitEvents).toBe(numberOfThreads) expect(poolDestroy).toBe(1)