From 7dd857e00ba99bca8b8cf4ea9d961b859c26a10f Mon Sep 17 00:00:00 2001 From: phiresky Date: Mon, 18 Sep 2023 19:19:40 +0000 Subject: [PATCH] log result --- api_tests/src/shared.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api_tests/src/shared.ts b/api_tests/src/shared.ts index 9d2bd3e02..df5d299c6 100644 --- a/api_tests/src/shared.ts +++ b/api_tests/src/shared.ts @@ -875,13 +875,15 @@ export async function waitUntil( delaySeconds = [0.2, 0.5, 1, 2, 3], ) { let retry = 0; + let result; while (retry++ < retries) { - const result = await fetcher(); + result = await fetcher(); if (checker(result)) return result; await delay( delaySeconds[Math.min(retry - 1, delaySeconds.length - 1)] * 1000, ); } + console.error("result", result); throw Error( `Failed "${fetcher}": "${checker}" did not return true after ${retries} retries (delayed ${delaySeconds}s each)`, );