mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-02-07 10:35:47 +00:00
fix in last test
This commit is contained in:
parent
a3c29ae7a1
commit
aa34c7f553
@ -229,18 +229,12 @@ suite "GossipSub Topic Membership Tests":
|
|||||||
currentGossip.fanout.len == 0
|
currentGossip.fanout.len == 0
|
||||||
|
|
||||||
let firstNodeGossip = GossipSub(nodes[0])
|
let firstNodeGossip = GossipSub(nodes[0])
|
||||||
let peersToUnsubscribe = firstNodeGossip.mesh[topic].toSeq()[0 .. 2]
|
let peersToUnsubscribe = nodes[1 ..< 3]
|
||||||
let peerIdsToUnsubscribe = peersToUnsubscribe.mapIt(it.peerId)
|
for peer in peersToUnsubscribe:
|
||||||
for node in nodes:
|
peer.unsubscribe(topic, voidTopicHandler)
|
||||||
for peerId in peerIdsToUnsubscribe:
|
|
||||||
node.unsubscribe(topic, voidTopicHandler)
|
|
||||||
node.peers.del(peerId)
|
|
||||||
|
|
||||||
await sleepAsync(3 * DURATION_TIMEOUT)
|
await sleepAsync(3 * DURATION_TIMEOUT)
|
||||||
|
|
||||||
check firstNodeGossip.mesh.getOrDefault(topic).len == 3
|
check firstNodeGossip.mesh.getOrDefault(topic).len == 3
|
||||||
|
|
||||||
for peer in peersToUnsubscribe:
|
|
||||||
check not firstNodeGossip.mesh[topic].contains(peer)
|
|
||||||
|
|
||||||
await allFuturesThrowing(nodes.mapIt(allFutures(it.switch.stop())))
|
await allFuturesThrowing(nodes.mapIt(allFutures(it.switch.stop())))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user