X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fpools%2Fcluster%2Ffixed.test.js;h=42f03b893d7c4f950e1950d3a23a5aec64fb88f4;hb=e211bc1861384013439097460a1bfb45e76eedd6;hp=34c066100aff925579f80a8876c03a4b4d81e695;hpb=feec4213515cceb460e722dedca403914764b487;p=poolifier.git diff --git a/tests/pools/cluster/fixed.test.js b/tests/pools/cluster/fixed.test.js index 34c06610..42f03b89 100644 --- a/tests/pools/cluster/fixed.test.js +++ b/tests/pools/cluster/fixed.test.js @@ -89,7 +89,7 @@ describe('Fixed cluster pool test suite', () => { }) it('Verify that tasks queuing is working', async () => { - const maxMultiplier = 10 + const maxMultiplier = 2 const promises = new Set() for (let i = 0; i < numberOfWorkers * maxMultiplier; i++) { promises.add(queuePool.execute()) @@ -137,6 +137,11 @@ describe('Fixed cluster pool test suite', () => { expect(inError).toBeDefined() expect(typeof inError === 'string').toBe(true) expect(inError).toBe('Error Message from ClusterWorker') + expect( + errorPool.workerNodes.some( + workerNode => workerNode.tasksUsage.error === 1 + ) + ).toBe(true) }) it('Verify that error handling is working properly:async', async () => { @@ -150,6 +155,11 @@ describe('Fixed cluster pool test suite', () => { expect(inError).toBeDefined() expect(typeof inError === 'string').toBe(true) expect(inError).toBe('Error Message from ClusterWorker:async') + expect( + asyncErrorPool.workerNodes.some( + workerNode => workerNode.tasksUsage.error === 1 + ) + ).toBe(true) }) it('Verify that async function is working properly', async () => {