Skip to content

Commit 8f6e91e

Browse files
committed
Explicitly close all connections (the call to shutdown should handle this properly but sometimes we get eventloop scheduling errors)
1 parent 49c947f commit 8f6e91e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Tests/LibP2PPubSubTests/LibP2PPubSubFloodsubTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,11 @@ class LibP2PPubSubFloodsubTests: XCTestCase {
499499

500500
nodes.first!.libp2p.peers.dumpAll()
501501

502+
/// Close all connections
503+
for node in nodes {
504+
try? node.libp2p.connections.closeAllConnections().wait()
505+
}
506+
502507
/// Stop the nodes
503508
for node in nodes { node.libp2p.shutdown() }
504509

Tests/LibP2PPubSubTests/LibP2PPubSubGossipsubTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,11 @@ class LibP2PPubSubGossipsubTests: XCTestCase {
533533
nodes.first!.libp2p.peers.dumpAll()
534534
nodes.first!.libp2p.pubsub.gossipsub.dumpEventList()
535535

536+
/// Close all connections
537+
for node in nodes {
538+
try? node.libp2p.connections.closeAllConnections().wait()
539+
}
540+
536541
/// Stop the nodes
537542
for node in nodes { node.libp2p.shutdown() }
538543

0 commit comments

Comments
 (0)