From e3ab97915fc77f2f368f015195d9fce8bae1a9fe Mon Sep 17 00:00:00 2001 From: Nguyen Thanh Dat Date: Tue, 25 Aug 2026 18:37:00 +0700 Subject: [PATCH] test(observer-status): set process.exitCode so the summary always flushes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review feedback on #2878. stdout is async when it is a pipe, which is exactly how tests/run-all.js runs these files, and process.exit() does not wait for pending writes — so exiting that way can drop the Passed:/Failed: lines the aggregator totals, defeating the previous commit. The sibling tests/ci/ito-*-skill.test.js files already use process.exitCode. Still exits 1 on a broken counter (Passed: 4, Failed: 7) and 0 when clean. --- tests/skills/observer-status-instinct-count.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/skills/observer-status-instinct-count.test.js b/tests/skills/observer-status-instinct-count.test.js index 223c40325..d65a850ca 100644 --- a/tests/skills/observer-status-instinct-count.test.js +++ b/tests/skills/observer-status-instinct-count.test.js @@ -204,7 +204,10 @@ function main() { console.log(`\n Passed: ${passed}`); console.log(` Failed: ${failed}`); - if (failed > 0) process.exit(1); + // exitCode, not exit(1): stdout is async when it is a pipe, which is how + // tests/run-all.js runs this, and process.exit() does not wait for pending + // writes — it could drop the two lines above, which the aggregator totals. + if (failed > 0) process.exitCode = 1; } main();