tests: Assume failure in case the async task vanishes.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2025-04-29 13:15:00 -07:00
committed by Tim Abbott
parent 16ac3c019a
commit b248e2d931

View File

@@ -101,6 +101,10 @@ async function run_one_module(file) {
test.set_verbose(files.length === 1);
// In case someone mistakenly vanishes the async task with something like `await
// new Promise(() => {})`, assume failure until we establish otherwise.
process.exitCode = 1;
(async () => {
let exit_code = 0;
@@ -144,8 +148,7 @@ test.set_verbose(files.length === 1);
namespace.finish();
}
process.exit(exit_code);
process.exitCode = exit_code;
})().catch((error) => /* istanbul ignore next */ {
console.error(error);
process.exit(1);
});