X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=inline;f=tests%2Fpools%2Fcluster%2Fdynamic.test.js;h=2cff475f99cd6b0368b216a9f45931fd7050fed6;hb=8bc7762018845abb73680eb1bbd65802b002ea08;hp=fbeb77cf3555c76ce1a93b53b926cee8f505ce91;hpb=4dc274761ce688172117009d1b306077d321f461;p=poolifier.git diff --git a/tests/pools/cluster/dynamic.test.js b/tests/pools/cluster/dynamic.test.js index fbeb77cf..2cff475f 100644 --- a/tests/pools/cluster/dynamic.test.js +++ b/tests/pools/cluster/dynamic.test.js @@ -62,8 +62,10 @@ describe('Dynamic cluster pool test suite ', () => { 1, './tests/worker-files/cluster/testWorker.js' ) - const res = await pool1.execute({ test: 'test' }) - expect(res).toBeFalsy() + const result = await pool1.execute({ test: 'test' }) + expect(result).toBeFalsy() + // We need to clean up the resources after our test + await pool1.destroy() }) it('Verify scale processes up and down is working when long running task is used:hard', async () => { @@ -80,6 +82,8 @@ describe('Dynamic cluster pool test suite ', () => { await TestUtils.waitExits(longRunningPool, max - min) // Here we expect the workers to be at the max size since that the task is still running expect(longRunningPool.workers.length).toBe(min) + // We need to clean up the resources after our test + await longRunningPool.destroy() }) it('Verify scale processes up and down is working when long running task is used:soft', async () => { @@ -96,5 +100,7 @@ describe('Dynamic cluster pool test suite ', () => { await TestUtils.sleep(1500) // Here we expect the workers to be at the max size since that the task is still running expect(longRunningPool.workers.length).toBe(max) + // We need to clean up the resources after our test + await longRunningPool.destroy() }) })