Skip to content

fix: resolve flaky p2p_client test race condition on ARM64#21088

Merged
PhilWindle merged 1 commit intomerge-train/barretenbergfrom
claudebox/fix-bb-merge-train-dequeue
Mar 4, 2026
Merged

fix: resolve flaky p2p_client test race condition on ARM64#21088
PhilWindle merged 1 commit intomerge-train/barretenbergfrom
claudebox/fix-bb-merge-train-dequeue

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 4, 2026

Fixes a flaky test failure that dequeued #21084 from the merge queue.

The test triggers tx collection for missing txs from mined blocks in p2p_client.test.ts was flaky because client.start() kicks off a background block stream that processes the initial 100 blocks. This background work could complete before the test overrides the hasTxs mock, so startCollecting gets called for block 100 with the default mock (making all txs look "missing").

Fix: Drain the initial background sync with an explicit sync() call before setting up the test scenario, and clear stale mock calls with mockClear() before the assertion sync.

ClaudeBox log: http://ci.aztec-labs.com/5c9e693e161264ba-1

The test 'triggers tx collection for missing txs from mined blocks' was
flaky on ARM64 because client.start() kicks off a background block stream
that may process the initial 100 blocks and call startCollecting before
the test overrides the hasTxs mock. On faster x86 machines, the mock
override happens before the background work completes, masking the race.

Fix: drain the initial background sync with an explicit sync() call
before setting up the test scenario, and clear stale mock calls before
the assertion sync.
@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Mar 4, 2026
@PhilWindle PhilWindle marked this pull request as ready for review March 4, 2026 10:55
@PhilWindle PhilWindle enabled auto-merge (squash) March 4, 2026 10:56
@PhilWindle PhilWindle merged commit 695e8fb into merge-train/barretenberg Mar 4, 2026
24 of 27 checks passed
@PhilWindle PhilWindle deleted the claudebox/fix-bb-merge-train-dequeue branch March 4, 2026 11:07
johnathan79717 pushed a commit that referenced this pull request Mar 4, 2026
Fixes a flaky test failure that dequeued
#21084 from the
merge queue.

The test `triggers tx collection for missing txs from mined blocks` in
`p2p_client.test.ts` was flaky because `client.start()` kicks off a
background block stream that processes the initial 100 blocks. This
background work could complete before the test overrides the `hasTxs`
mock, so `startCollecting` gets called for block 100 with the default
mock (making all txs look "missing").

**Fix**: Drain the initial background sync with an explicit `sync()`
call before setting up the test scenario, and clear stale mock calls
with `mockClear()` before the assertion sync.

ClaudeBox log: http://ci.aztec-labs.com/5c9e693e161264ba-1
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2026
BEGIN_COMMIT_OVERRIDE
fix: add -g0 to zig presets to eliminate 11GB debug info bloat (#21071)
fix: resolve flaky p2p_client test race condition on ARM64 (#21088)
chore: remove domain iteration macros and address backing memory race
(#20988)
fix: [ECCVM] added domain separation for the multiset equality check.
(#20352)
feat: hybrid CRS hash verification — 8MB chunks, parallel, span-based
(#21113)
chore: unify splitting scalars interface (#20805)
chore: add a unique id to each origin tag (#20924)
chore: Native curve audit (#20936)
chore: Update bootstrap in test vk haven't changed script (#21153)
fix: use reduced form in WASM FromMontgomeryForm test (#21164)
chore: erase ephemeral secrets from memory in schnorr and aes (#21106)
chore: suppress clangd target triple version diagnostic (#21180)
feat: Optimise new claim calculation (#21179)
docs: add Quick Start build instructions to barretenberg README (#20951)
feat: batched chonk verification (#21083)
fix: link libc++ instead of libstdc++ for Rust FFI on Linux (#21203)
fix: [ECCVM] in the transcript table, no-ops force the next accumulator
to be 0. (#20849)
fix: resolve merge-train conflict with next (zig wrapper scripts + -g0)
(#21201)
fix: [ECCVM] rare edge case completeness issue when `z1 == 0` but `z2 !=
0` (#20858)
fix: use actual data extent for CommitmentKey in HypernovaDeciderProver
(#21206)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants