test: handle special case in TestUtils.waitExits()
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 26 May 2023 11:25:52 +0000 (13:25 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 26 May 2023 11:25:52 +0000 (13:25 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
tests/test-utils.js

index a23d8948b146408e85b30b8d5e4c9ded9248d7c1..0e71c718a8eee83c85011e10f417725811ae34f8 100644 (file)
@@ -4,6 +4,9 @@ class TestUtils {
   static async waitExits (pool, numberOfExitEventsToWait) {
     return new Promise(resolve => {
       let exitEvents = 0
+      if (numberOfExitEventsToWait === 0) {
+        resolve(exitEvents)
+      }
       for (const workerNode of pool.workerNodes) {
         workerNode.worker.on('exit', () => {
           ++exitEvents