aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
authorMartin Zumsande <mzumsande@gmail.com>2022-11-03 11:46:07 -0400
committerMartin Zumsande <mzumsande@gmail.com>2022-11-03 16:41:50 -0400
commit74d975318a1443aebfbcee36e331df4e54ec1fbe (patch)
tree217b8e1fa0734da6ad818a5069051eac2198bb91 /test/functional/test_framework
parent5274f324375fd31cf8507531fbc612765d03092f (diff)
downloadbitcoin-74d975318a1443aebfbcee36e331df4e54ec1fbe.tar.xz
test: fix intermittent failure in p2p_sendtxrcncl.py
Using disconnect_p2ps instead of peer_disconnect makes the node wait for the disconnect to complete. As a result, we can reuse p2p_idx=0 in the add_outbound_p2p_connection calls.
Diffstat (limited to 'test/functional/test_framework')
-rwxr-xr-xtest/functional/test_framework/test_node.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index 83f9f253fd..0075fa0996 100755
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -625,6 +625,10 @@ class TestNode():
This method adds the p2p connection to the self.p2ps list and returns
the connection to the caller.
+
+ p2p_idx must be different for simultaneously connected peers. When reusing it for the next peer
+ after disconnecting the previous one, it is necessary to wait for the disconnect to finish to avoid
+ a race condition.
"""
def addconnection_callback(address, port):