X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fpools%2Futils.test.mjs;h=adff47d9ba9781687a9fb89daa31dea7841fa8ca;hb=af7f2788b6fcc39343d544551cf17c8f0dc5b757;hp=5feb6596296914252a94231e5de19132968a832f;hpb=c3719753af0a9be03abf722a7543495359e817b5;p=poolifier.git diff --git a/tests/pools/utils.test.mjs b/tests/pools/utils.test.mjs index 5feb6596..adff47d9 100644 --- a/tests/pools/utils.test.mjs +++ b/tests/pools/utils.test.mjs @@ -7,11 +7,23 @@ import { } from '../../lib/circular-array.js' import { createWorker, + getDefaultTasksQueueOptions, updateMeasurementStatistics } from '../../lib/pools/utils.js' import { WorkerTypes } from '../../lib/index.js' describe('Pool utils test suite', () => { + it('Verify getDefaultTasksQueueOptions() behavior', () => { + const poolMaxSize = 4 + expect(getDefaultTasksQueueOptions(poolMaxSize)).toStrictEqual({ + concurrency: 1, + size: Math.pow(poolMaxSize, 2), + taskStealing: true, + tasksStealingOnBackPressure: true, + tasksFinishedTimeout: 2000 + }) + }) + it('Verify updateMeasurementStatistics() behavior', () => { const measurementStatistics = { history: new CircularArray()