From e418e422dbc7b2fc21c9db4b9183542644845af5 Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Tue, 23 Apr 2024 19:00:55 +0300 Subject: [PATCH 1/2] fix: adding delay between dials --- packages/tests/tests/getPeers.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/tests/tests/getPeers.spec.ts b/packages/tests/tests/getPeers.spec.ts index bc5f6e690b..7bf96311f7 100644 --- a/packages/tests/tests/getPeers.spec.ts +++ b/packages/tests/tests/getPeers.spec.ts @@ -20,6 +20,7 @@ import Sinon from "sinon"; import { afterEachCustom, beforeEachCustom, + delay, isNwakuAtLeast, makeLogFileName, resolveAutoshardingCluster, @@ -170,6 +171,7 @@ describe("getConnectedPeersForProtocolAndShard", function () { waku = await createLightNode({ shardInfo: shardInfo2 }); await waku.libp2p.dialProtocol(serviceNode1Ma, LightPushCodec); + await delay(500); await waku.libp2p.dialProtocol(serviceNode2Ma, LightPushCodec); await waku.start(); @@ -223,6 +225,7 @@ describe("getConnectedPeersForProtocolAndShard", function () { waku = await createLightNode({ shardInfo: shardInfo2 }); await waku.libp2p.dialProtocol(serviceNodeMa1, LightPushCodec); + await delay(500); // Small delay between dials await waku.libp2p.dialProtocol(serviceNodeMa2, LightPushCodec); await waku.start(); await waitForRemotePeer(waku, [Protocols.LightPush]); @@ -362,6 +365,7 @@ describe("getConnectedPeersForProtocolAndShard", function () { waku = await createLightNode({ shardInfo: shardInfo2 }); await waku.libp2p.dialProtocol(serviceNode1Ma, LightPushCodec); + await delay(500); await waku.libp2p.dialProtocol(serviceNode2Ma, LightPushCodec); await waku.start(); @@ -416,6 +420,7 @@ describe("getConnectedPeersForProtocolAndShard", function () { waku = await createLightNode({ shardInfo: shardInfo2 }); await waku.libp2p.dialProtocol(serviceNodeMa1, LightPushCodec); + await delay(500); await waku.libp2p.dialProtocol(serviceNodeMa2, LightPushCodec); await waku.start(); await waitForRemotePeer(waku, [Protocols.LightPush]); From fc316c6223758201322e70ae9102a42d3dfad716 Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Tue, 23 Apr 2024 19:02:08 +0300 Subject: [PATCH 2/2] removing comment --- packages/tests/tests/getPeers.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tests/tests/getPeers.spec.ts b/packages/tests/tests/getPeers.spec.ts index 7bf96311f7..d6f846694f 100644 --- a/packages/tests/tests/getPeers.spec.ts +++ b/packages/tests/tests/getPeers.spec.ts @@ -225,7 +225,7 @@ describe("getConnectedPeersForProtocolAndShard", function () { waku = await createLightNode({ shardInfo: shardInfo2 }); await waku.libp2p.dialProtocol(serviceNodeMa1, LightPushCodec); - await delay(500); // Small delay between dials + await delay(500); await waku.libp2p.dialProtocol(serviceNodeMa2, LightPushCodec); await waku.start(); await waitForRemotePeer(waku, [Protocols.LightPush]);