diff --git a/src/lib/waku_relay/index.spec.ts b/src/lib/waku_relay/index.spec.ts index 816ac19010..67492c9057 100644 --- a/src/lib/waku_relay/index.spec.ts +++ b/src/lib/waku_relay/index.spec.ts @@ -270,6 +270,16 @@ describe('Waku Relay', () => { waku2.dial(nimWakuMultiaddr), ]); + // Wait for identify protocol to finish + await Promise.all([ + new Promise((resolve) => + waku1.libp2p.peerStore.once('change:protocols', resolve) + ), + new Promise((resolve) => + waku2.libp2p.peerStore.once('change:protocols', resolve) + ), + ]); + await Promise.all([ new Promise((resolve) => waku1.libp2p.pubsub.once('gossipsub:heartbeat', resolve)