From: Jérôme Benoit Date: Fri, 18 Aug 2023 18:48:14 +0000 (+0200) Subject: test: improve multiple task functions worker usage test X-Git-Tag: v2.6.29~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b414b84cc22efd9df5d9b7c5a470125955cd0f1c;hp=ff469b0e10fd914cea250352eeb60008a889789d;p=poolifier.git test: improve multiple task functions worker usage test Signed-off-by: Jérôme Benoit --- diff --git a/tests/pools/abstract/abstract-pool.test.js b/tests/pools/abstract/abstract-pool.test.js index 58d221ab..0929adc3 100644 --- a/tests/pools/abstract/abstract-pool.test.js +++ b/tests/pools/abstract/abstract-pool.test.js @@ -915,8 +915,15 @@ describe('Abstract pool test suite', () => { expect(result3).toBe(55) expect(pool.info.executingTasks).toBe(0) expect(pool.info.executedTasks).toBe(4) - for (const name of pool.listTaskFunctions()) { - for (const workerNode of pool.workerNodes) { + for (const workerNode of pool.workerNodes) { + expect(workerNode.info.taskFunctions).toStrictEqual([ + 'default', + 'jsonIntegerSerialization', + 'factorial', + 'fibonacci' + ]) + expect(workerNode.taskFunctionsUsage.size).toBe(3) + for (const name of pool.listTaskFunctions()) { expect(workerNode.getTaskFunctionWorkerUsage(name)).toStrictEqual({ tasks: { executed: expect.any(Number),