Skip to content

Commit 4115bf9

Browse files
authored
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)
1 parent 4cc0a6d commit 4115bf9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

yarn-project/prover-node/src/prover-node.test.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
import { type ContractDataSource, EthAddress, Fr } from '@aztec/circuits.js';
1616
import { times } from '@aztec/foundation/collection';
1717
import { Signature } from '@aztec/foundation/eth-signature';
18+
import { makeBackoff, retry } from '@aztec/foundation/retry';
1819
import { sleep } from '@aztec/foundation/sleep';
1920
import { openTmpStore } from '@aztec/kv-store/lmdb';
2021
import {
@@ -368,10 +369,15 @@ describe('prover-node', () => {
368369
await proverNode.handleEpochCompleted(10n);
369370

370371
// Wait for message to be propagated
371-
await sleep(1000);
372-
373-
// Check the other node received a quote via p2p
374-
expect(p2pEpochReceivedSpy).toHaveBeenCalledTimes(1);
372+
await retry(
373+
// eslint-disable-next-line require-await
374+
async () => {
375+
// Check the other node received a quote via p2p
376+
expect(p2pEpochReceivedSpy).toHaveBeenCalledTimes(1);
377+
},
378+
'Waiting for quote to be received',
379+
makeBackoff(times(20, () => 1)),
380+
);
375381

376382
// We should be able to retreive the quote from the other node
377383
const peerFinalStateQuotes = await otherP2PClient.getEpochProofQuotes(10n);

0 commit comments

Comments
 (0)