Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { timesAsync } from '@aztec/foundation/collection';
import { randomBytes } from '@aztec/foundation/crypto/random';
import { Fr } from '@aztec/foundation/curves/bn254';
import { EthAddress } from '@aztec/foundation/eth-address';
import { sleep } from '@aztec/foundation/sleep';
import { retryUntil } from '@aztec/foundation/retry';
import type { SiblingPath } from '@aztec/foundation/trees';
import { PublicDataWrite } from '@aztec/stdlib/avm';
import { L2Block } from '@aztec/stdlib/block';
Expand Down Expand Up @@ -960,7 +960,10 @@ describe('NativeWorldState', () => {
await ws.unwindBlocks(BlockNumber.fromBigInt(2n));
await expect(delayedFork.getSiblingPath(MerkleTreeId.NULLIFIER_TREE, 0n)).rejects.toThrow('Fork not found');

await sleep(closeDelayMs * 3);
// The delayed close fires after closeDelayMs and then asynchronously deletes the per-fork queue entry
// once its DELETE_FORK round-trip settles. Under a loaded CI grind that cleanup can take longer than a
// fixed sleep, so wait for it deterministically instead of racing closeDelayMs * 3.
await retryUntil(() => !(ws as any).instance.queues.has(forkId), 'delayed-close fork queue cleanup', 30, 0.1);

expect(warnSpy).not.toHaveBeenCalled();
expect((ws as any).instance.queues.has(forkId)).toBe(false);
Expand Down
Loading