Skip to content

Commit

Permalink
reduce deadline duration to 1 second
Browse files Browse the repository at this point in the history
  • Loading branch information
kpandl committed Sep 12, 2024
1 parent bbd10c1 commit be550f3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions node/tests/disconnect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ macro_rules! test_disconnect {

// Check the peer counts.
let node_clone = node.clone();
deadline!(Duration::from_secs(5), move || node_clone.router().number_of_connected_peers() == 1);
deadline!(Duration::from_secs(1), move || node_clone.router().number_of_connected_peers() == 1);
let node_clone = node.clone();
deadline!(Duration::from_secs(5), move || node_clone.tcp().num_connected() == 1);
deadline!(Duration::from_secs(1), move || node_clone.tcp().num_connected() == 1);
let peer_clone = peer.clone();
deadline!(Duration::from_secs(5), move || peer_clone.node().num_connected() == 1);
deadline!(Duration::from_secs(1), move || peer_clone.node().num_connected() == 1);

// Disconnect.
if $node_disconnects {
Expand All @@ -70,9 +70,9 @@ macro_rules! test_disconnect {

// Check the peer counts have been updated.
let node_clone = node.clone();
deadline!(Duration::from_secs(5), move || node_clone.router().number_of_connected_peers() == 0);
deadline!(Duration::from_secs(5), move || node.tcp().num_connected() == 0);
deadline!(Duration::from_secs(5), move || peer.node().num_connected() == 0);
deadline!(Duration::from_secs(1), move || node_clone.router().number_of_connected_peers() == 0);
deadline!(Duration::from_secs(1), move || node.tcp().num_connected() == 0);
deadline!(Duration::from_secs(1), move || peer.node().num_connected() == 0);

}
};
Expand Down Expand Up @@ -185,7 +185,7 @@ async fn duplicate_disconnect_attempts() {

// Connection checks.
let node1_clone = node1.clone();
deadline!(Duration::from_secs(5), move || node1_clone.router().number_of_connected_peers() == 0);
deadline!(Duration::from_secs(1), move || node1_clone.router().number_of_connected_peers() == 0);
let node2_clone = node2.clone();
deadline!(Duration::from_secs(5), move || node2_clone.router().number_of_connected_peers() == 0);
deadline!(Duration::from_secs(1), move || node2_clone.router().number_of_connected_peers() == 0);
}

0 comments on commit be550f3

Please sign in to comment.