aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Zumsande <mzumsande@gmail.com>2021-12-18 11:03:53 +0100
committerMartin Zumsande <mzumsande@gmail.com>2021-12-18 11:40:55 +0100
commit0a1b6fa5a18f3efb2ac3e28a23a4fd5e1cf9eaf0 (patch)
tree5064563fc3d8c33fd573a7f79cafa4c13728322d
parent98a2ddcd6ed01a38cd0dad7c1abc7023a60d3fd0 (diff)
downloadbitcoin-0a1b6fa5a18f3efb2ac3e28a23a4fd5e1cf9eaf0.tar.xz
test: fix intermittent timeouts in p2p_timeouts.py
by checking that all nodes are added before the mocktime is bumped. Fixes #23800
-rwxr-xr-xtest/functional/p2p_timeouts.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/functional/p2p_timeouts.py b/test/functional/p2p_timeouts.py
index cf714bc888..48c9b1b56a 100755
--- a/test/functional/p2p_timeouts.py
+++ b/test/functional/p2p_timeouts.py
@@ -48,10 +48,13 @@ class TimeoutsTest(BitcoinTestFramework):
self.mock_time = int(time.time())
self.mock_forward(0)
- # Setup the p2p connections
- no_verack_node = self.nodes[0].add_p2p_connection(TestP2PConn(), wait_for_verack=False)
- no_version_node = self.nodes[0].add_p2p_connection(TestP2PConn(), send_version=False, wait_for_verack=False)
- no_send_node = self.nodes[0].add_p2p_connection(TestP2PConn(), send_version=False, wait_for_verack=False)
+ # Setup the p2p connections, making sure the connections are established before the mocktime is bumped
+ with self.nodes[0].assert_debug_log(['Added connection peer=0']):
+ no_verack_node = self.nodes[0].add_p2p_connection(TestP2PConn(), wait_for_verack=False)
+ with self.nodes[0].assert_debug_log(['Added connection peer=1']):
+ no_version_node = self.nodes[0].add_p2p_connection(TestP2PConn(), send_version=False, wait_for_verack=False)
+ with self.nodes[0].assert_debug_log(['Added connection peer=2']):
+ no_send_node = self.nodes[0].add_p2p_connection(TestP2PConn(), send_version=False, wait_for_verack=False)
# Wait until we got the verack in response to the version. Though, don't wait for the other node to receive the
# verack, since we never sent one