From 54d97b9cb767d5c60e692860d8e59c842c20e5f8 Mon Sep 17 00:00:00 2001 From: Barrett LaFrance Date: Mon, 6 Jan 2025 11:28:57 -0600 Subject: [PATCH] test: add add'l try/catch logging --- hack/load.cli.ts | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/hack/load.cli.ts b/hack/load.cli.ts index fdd70ba7c..1f860cbc1 100644 --- a/hack/load.cli.ts +++ b/hack/load.cli.ts @@ -736,8 +736,15 @@ program .concat("\n"); await fs.appendFile(audFile, outlines); }; - audience(); // run immediately, then on schedule - const ticket = setInterval(audience, opts.audInterval); + await audience(); // run immediately, then on schedule + const ticket = setInterval(async () => { + try { + await audience(); + } catch (e) { + console.error(e); + process.exit(1); + } + }, opts.audInterval); await nap(opts.stagger); // stagger interval starts @@ -763,9 +770,15 @@ program await fs.appendFile(actFile, Date.now().toString() + "\n"); } }; - actress(); // run immediately, then on schedule - const backstagePass = setInterval(() => actress(abort), opts.actInterval); - + await actress(); // run immediately, then on schedule + const backstagePass = setInterval(async () => { + try { + await actress(abort); + } catch (e) { + console.error(e); + process.exit(1); + } + }, opts.actInterval); // wait until total duration has elapsed const startWait = Date.now(); await nap(opts.duration - (startWait - alpha));