Skip to content

Commit

Permalink
fix in last test
Browse files Browse the repository at this point in the history
  • Loading branch information
shashankshampi committed Oct 24, 2024
1 parent a3c29ae commit aa34c7f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/pubsub/testgossipmembership.nim
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,12 @@ suite "GossipSub Topic Membership Tests":
currentGossip.fanout.len == 0

let firstNodeGossip = GossipSub(nodes[0])
let peersToUnsubscribe = firstNodeGossip.mesh[topic].toSeq()[0 .. 2]
let peerIdsToUnsubscribe = peersToUnsubscribe.mapIt(it.peerId)
for node in nodes:
for peerId in peerIdsToUnsubscribe:
node.unsubscribe(topic, voidTopicHandler)
node.peers.del(peerId)
let peersToUnsubscribe = nodes[1 ..< 3]
for peer in peersToUnsubscribe:
peer.unsubscribe(topic, voidTopicHandler)

await sleepAsync(3 * DURATION_TIMEOUT)

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())))

0 comments on commit aa34c7f

Please sign in to comment.