From 80a9525157a7c049ddb292db8cd3a997c19732b2 Mon Sep 17 00:00:00 2001 From: gabrielmer <101006718+gabrielmer@users.noreply.github.com> Date: Wed, 24 Apr 2024 19:18:33 +0300 Subject: [PATCH] fix: adding delay between dials (#1973) * fix: adding delay between dials * removing comment --- 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..d6f846694f 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); 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]);