X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fpools%2Fthread%2Ffixed.test.js;h=ef368968922282de2d5090f4d68242946c46e481;hb=09c2d0d3bf72a566a9460155ef62b052e53411aa;hp=2d689feda6a86b2fda9f03fbbbd2d62fec6f9bef;hpb=e211bc1861384013439097460a1bfb45e76eedd6;p=poolifier.git diff --git a/tests/pools/thread/fixed.test.js b/tests/pools/thread/fixed.test.js index 2d689fed..ef368968 100644 --- a/tests/pools/thread/fixed.test.js +++ b/tests/pools/thread/fixed.test.js @@ -89,8 +89,8 @@ describe('Fixed thread pool test suite', () => { }) it('Verify that tasks queuing is working', async () => { - const maxMultiplier = 2 const promises = new Set() + const maxMultiplier = 2 for (let i = 0; i < numberOfThreads * maxMultiplier; i++) { promises.add(queuePool.execute()) } @@ -110,9 +110,9 @@ describe('Fixed thread pool test suite', () => { for (const workerNode of queuePool.workerNodes) { expect(workerNode.tasksUsage.running).toBe(0) expect(workerNode.tasksUsage.run).toBeGreaterThan(0) + expect(workerNode.tasksUsage.run).toBeLessThanOrEqual(maxMultiplier) expect(workerNode.tasksQueue.size).toBe(0) } - promises.clear() }) it('Verify that is possible to have a worker that return undefined', async () => {