From 539bf47bcc2141c56ec145f0c41aa5f9e866d207 Mon Sep 17 00:00:00 2001 From: BluJ Date: Fri, 28 Apr 2023 15:38:06 -0600 Subject: [PATCH] chore: Make sure that the health check doesn't stop the wholesystem --- lib/mainFn/Daemons.ts | 8 +++++++- lib/test/makeOutput.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/mainFn/Daemons.ts b/lib/mainFn/Daemons.ts index f6b87f8..f895993 100644 --- a/lib/mainFn/Daemons.ts +++ b/lib/mainFn/Daemons.ts @@ -95,7 +95,13 @@ export class Daemons { !res.done; res = await trigger.next() ) { - const response = await daemon.ready.fn() + const response = await Promise.resolve(daemon.ready.fn()).catch( + (err) => + ({ + status: "failing", + message: "message" in err ? err.message : String(err), + } as CheckResult), + ) currentInput.lastResult = response.status || null if (!currentInput.hadSuccess && response.status === "passing") { currentInput.hadSuccess = true diff --git a/lib/test/makeOutput.ts b/lib/test/makeOutput.ts index b2e2447..9386833 100644 --- a/lib/test/makeOutput.ts +++ b/lib/test/makeOutput.ts @@ -406,6 +406,6 @@ oldSpecToBuilder( }, }, { - startSdk: "../", + startSdk: "start-sdk/lib", }, )