Skip to content

Commit b2df1b3

Browse files
authored
test(ws): await close promise in native world state test (#23563)
Tackles flake at [this run](http://ci.aztec-labs.com/f68773618307b3a1) by awaiting the close promise on the fork. ``` 22:00:44 ● NativeWorldState › Pending and Proven chain › does not fail when a delayed-close fork is destroyed by a reorg before its close fires 22:00:44 22:00:44 expect(received).toBe(expected) // Object.is equality 22:00:44 22:00:44 Expected: false 22:00:44 Received: true 22:00:44 22:00:44 964 | 22:00:44 965 | expect(warnSpy).not.toHaveBeenCalled(); 22:00:44 > 966 | expect((ws as any).instance.queues.has(forkId)).toBe(false); 22:00:44 | ^ 22:00:44 967 | }); 22:00:44 968 | }); 22:00:44 969 | 22:00:44 22:00:44 at Object.toBe (native/native_world_state.test.ts:966:55) ```
1 parent 7b0dcc3 commit b2df1b3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

yarn-project/world-state/src/native/native_world_state.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,9 @@ describe('NativeWorldState', () => {
961961
await expect(delayedFork.getSiblingPath(MerkleTreeId.NULLIFIER_TREE, 0n)).rejects.toThrow('Fork not found');
962962

963963
await sleep(closeDelayMs * 3);
964+
const closePromise = (delayedFork as any).closePromise;
965+
expect(closePromise).toBeDefined();
966+
await closePromise;
964967

965968
expect(warnSpy).not.toHaveBeenCalled();
966969
expect((ws as any).instance.queues.has(forkId)).toBe(false);

0 commit comments

Comments
 (0)