From be550f3daf830ea8135dd0d77a4496f3e554f60c Mon Sep 17 00:00:00 2001 From: Konstantin Pandl <16907747+kpandl@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:16:20 +0200 Subject: [PATCH] reduce deadline duration to 1 second --- node/tests/disconnect.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/node/tests/disconnect.rs b/node/tests/disconnect.rs index 5b6ec3b925..e0322f7f10 100644 --- a/node/tests/disconnect.rs +++ b/node/tests/disconnect.rs @@ -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 { @@ -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); } }; @@ -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); }