Skip to content

Commit 34084a4

Browse files
committed
test(p2p): limit time to calm events down
1 parent efd9ba2 commit 34084a4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

node/testing/src/scenarios/p2p/basic_connection_handling.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,14 @@ impl AllNodesConnectionsAreSymmetric {
125125
.collect();
126126

127127
// Run the cluster while there are events
128+
let timeout = std::time::Instant::now() + Duration::from_secs(2 * 60);
128129
while driver
129130
.run_until(Duration::from_secs(30), |_, _, _| true)
130131
.await
131132
.unwrap()
132-
{}
133+
{
134+
assert!(std::time::Instant::now() < timeout, "cluster should stop generating events");
135+
}
133136

134137
// Check that for each peer, if it is in the node's peer list, then the node is in the peer's peer list
135138
for (peer1, peer_id1) in &peers {
@@ -264,7 +267,7 @@ impl MaxNumberOfPeers {
264267
.unwrap();
265268
assert!(satisfied, "all peers should be listening");
266269

267-
eprintln!("connecting nodes....");
270+
println!("connecting nodes....");
268271

269272
for peer in &peers {
270273
driver

0 commit comments

Comments
 (0)