diff --git a/scripts/mocha/mocha_run.mjs b/scripts/mocha/mocha_run.mjs index 38c2974b4c04..abb4b1700c61 100644 --- a/scripts/mocha/mocha_run.mjs +++ b/scripts/mocha/mocha_run.mjs @@ -35,7 +35,8 @@ async function exitScenarioHandler(code) { // Process does not seems to exit with one `process.exit(-1)`, so we try a few times for (let i = 0; i < 5; i++) { - process.exit(-1); + // If there are some failures in the test, we exit with -1 + process.exit(code > 0 ? -1 : 0); await sleep(100); }