From 4115bf985108e183f8a57aaf76289326251b8c7b Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Fri, 13 Dec 2024 11:24:17 -0300 Subject: [PATCH] chore: Add retries for prover node p2p test (#10699) Attempts to deflake runs like [this one](https://github.com/AztecProtocol/aztec-packages/actions/runs/12282938156) --- yarn-project/prover-node/src/prover-node.test.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/yarn-project/prover-node/src/prover-node.test.ts b/yarn-project/prover-node/src/prover-node.test.ts index a674c6f4068..8d09f5174d3 100644 --- a/yarn-project/prover-node/src/prover-node.test.ts +++ b/yarn-project/prover-node/src/prover-node.test.ts @@ -15,6 +15,7 @@ import { import { type ContractDataSource, EthAddress, Fr } from '@aztec/circuits.js'; import { times } from '@aztec/foundation/collection'; import { Signature } from '@aztec/foundation/eth-signature'; +import { makeBackoff, retry } from '@aztec/foundation/retry'; import { sleep } from '@aztec/foundation/sleep'; import { openTmpStore } from '@aztec/kv-store/lmdb'; import { @@ -368,10 +369,15 @@ describe('prover-node', () => { await proverNode.handleEpochCompleted(10n); // Wait for message to be propagated - await sleep(1000); - - // Check the other node received a quote via p2p - expect(p2pEpochReceivedSpy).toHaveBeenCalledTimes(1); + await retry( + // eslint-disable-next-line require-await + async () => { + // Check the other node received a quote via p2p + expect(p2pEpochReceivedSpy).toHaveBeenCalledTimes(1); + }, + 'Waiting for quote to be received', + makeBackoff(times(20, () => 1)), + ); // We should be able to retreive the quote from the other node const peerFinalStateQuotes = await otherP2PClient.getEpochProofQuotes(10n);