From: Jérôme Benoit Date: Thu, 17 Nov 2022 22:53:46 +0000 (+0100) Subject: Fix closure issue in UTs utils X-Git-Tag: v2.3.8~91 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f821a8411ccb1217a6deb9d2e082eecc4ba6d9b4;p=poolifier.git Fix closure issue in UTs utils Signed-off-by: Jérôme Benoit --- diff --git a/tests/test-utils.js b/tests/test-utils.js index 116b1942..f650af78 100644 --- a/tests/test-utils.js +++ b/tests/test-utils.js @@ -2,8 +2,8 @@ const { WorkerFunctions } = require('./test-types') class TestUtils { static async waitExits (pool, numberOfExitEventsToWait) { - let exitEvents = 0 return new Promise(resolve => { + let exitEvents = 0 pool.workers.forEach(w => { w.on('exit', () => { exitEvents++