From db2a204ec182a6a1e6d3ee299b68f9fda690ece7 Mon Sep 17 00:00:00 2001 From: benesjan Date: Wed, 16 Aug 2023 11:42:16 +0000 Subject: [PATCH] CI fix --- yarn-project/end-to-end/src/e2e_aztec_js_browser.test.ts | 2 +- .../foundation/src/json-rpc/client/json_rpc_client.ts | 2 +- yarn-project/foundation/src/retry/index.ts | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/yarn-project/end-to-end/src/e2e_aztec_js_browser.test.ts b/yarn-project/end-to-end/src/e2e_aztec_js_browser.test.ts index c052734c543..6d7584dd5f1 100644 --- a/yarn-project/end-to-end/src/e2e_aztec_js_browser.test.ts +++ b/yarn-project/end-to-end/src/e2e_aztec_js_browser.test.ts @@ -126,7 +126,7 @@ conditionalDescribe()('e2e_aztec.js_browser', () => { const accounts = await testClient.getAccounts(); const stringAccounts = accounts.map(acc => acc.address.toString()); expect(stringAccounts.includes(result)).toBeTruthy(); - }); + }, 15_000); it('Deploys Private Token contract', async () => { const txHash = await page.evaluate( diff --git a/yarn-project/foundation/src/json-rpc/client/json_rpc_client.ts b/yarn-project/foundation/src/json-rpc/client/json_rpc_client.ts index 760d2f9db7b..2c0f340e888 100644 --- a/yarn-project/foundation/src/json-rpc/client/json_rpc_client.ts +++ b/yarn-project/foundation/src/json-rpc/client/json_rpc_client.ts @@ -47,7 +47,7 @@ export async function defaultFetch(host: string, rpcMethod: string, body: any, u throw new Error(`Failed to parse body as JSON: ${resp.text()}`); } if (!resp.ok) { - throw new Error(responseJson.error); + throw new Error(responseJson.error, { cause: 'thrownByServer' }); } return responseJson; diff --git a/yarn-project/foundation/src/retry/index.ts b/yarn-project/foundation/src/retry/index.ts index 0a098f45ef2..d03debae6ef 100644 --- a/yarn-project/foundation/src/retry/index.ts +++ b/yarn-project/foundation/src/retry/index.ts @@ -38,6 +38,12 @@ export async function retry( try { return await fn(); } catch (err: any) { + if (err.cause == 'thrownByServer') { + // If the error is specifically marked as thrown by the server, we don't retry because the error should be + // propagated. This is because it's an "intentional error" (e.g. "Contract is not deployed") and not + // a connection error or an unexpected software bug. + throw err; + } const s = backoff.next().value; if (s === undefined) { throw err;