aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/p2p.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-04-27 13:32:23 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-04-28 08:16:29 +0200
commitfaa51ef4d33034f8c14cfd18f1c01c90883a1bb4 (patch)
treefc99d13079acbab38be723e68b3391b73371081f /test/functional/test_framework/p2p.py
parentfa37116c820f6a84642d57ce709a5977fd5616c4 (diff)
downloadbitcoin-faa51ef4d33034f8c14cfd18f1c01c90883a1bb4.tar.xz
test: Fix intermittent issue in p2p_addr_relay.py
Diffstat (limited to 'test/functional/test_framework/p2p.py')
-rwxr-xr-xtest/functional/test_framework/p2p.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/functional/test_framework/p2p.py b/test/functional/test_framework/p2p.py
index 05099f3339..cc80b543cd 100755
--- a/test/functional/test_framework/p2p.py
+++ b/test/functional/test_framework/p2p.py
@@ -539,8 +539,16 @@ class P2PInterface(P2PConnection):
self.send_message(message)
self.sync_with_ping(timeout=timeout)
- # Sync up with the node
+ def sync_send_with_ping(self, timeout=60):
+ """Ensure SendMessages is called on this connection"""
+ # Calling sync_with_ping twice requires that the node calls
+ # `ProcessMessage` twice, and thus ensures `SendMessages` must have
+ # been called at least once
+ self.sync_with_ping()
+ self.sync_with_ping()
+
def sync_with_ping(self, timeout=60):
+ """Ensure ProcessMessages is called on this connection"""
self.send_message(msg_ping(nonce=self.ping_counter))
def test_function():