From: Jérôme Benoit Date: Fri, 26 May 2023 11:25:52 +0000 (+0200) Subject: test: handle special case in TestUtils.waitExits() X-Git-Tag: v2.5.0~23 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=de4e1d69cb0f5e51de82c7c595c98d172bf16358;p=poolifier.git test: handle special case in TestUtils.waitExits() Signed-off-by: Jérôme Benoit --- diff --git a/tests/test-utils.js b/tests/test-utils.js index a23d8948..0e71c718 100644 --- a/tests/test-utils.js +++ b/tests/test-utils.js @@ -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