Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add retries for prover node p2p test #10699

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions yarn-project/prover-node/src/prover-node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -367,10 +368,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);
Expand Down
Loading