test: improve multiple task functions worker usage test
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 18 Aug 2023 18:48:14 +0000 (20:48 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 18 Aug 2023 18:48:14 +0000 (20:48 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
tests/pools/abstract/abstract-pool.test.js

index 58d221ab04a996f7dc8b98272b54c7d607f2d5b0..0929adc36a60dcfa0422ad6908041484736ee28c 100644 (file)
@@ -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),