diff --git a/test/functional/abc-invalid-message.py b/test/functional/abc-invalid-message.py --- a/test/functional/abc-invalid-message.py +++ b/test/functional/abc-invalid-message.py @@ -12,7 +12,6 @@ from test_framework.messages import NODE_NETWORK, msg_version from test_framework.p2p import ( - p2p_lock, msg_ping, P2PInterface, ) @@ -81,7 +80,7 @@ if not interface.last_message.get("pong"): return False return interface.last_message["pong"].nonce == interface.ping_counter - self.wait_until(check_ping, lock=p2p_lock) + interface.wait_until(check_ping) interface.ping_counter += 1 # The valid message is accepted diff --git a/test/functional/p2p_leak.py b/test/functional/p2p_leak.py --- a/test/functional/p2p_leak.py +++ b/test/functional/p2p_leak.py @@ -18,10 +18,7 @@ msg_ping, msg_version, ) -from test_framework.p2p import ( - p2p_lock, - P2PInterface, -) +from test_framework.p2p import P2PInterface from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, @@ -142,14 +139,13 @@ # verack, since we never sent one no_verack_idle_peer.wait_for_verack() - self.wait_until( + no_version_disconnect_peer.wait_until( lambda: no_version_disconnect_peer.ever_connected, - timeout=10, - lock=p2p_lock) - self.wait_until(lambda: no_version_idle_peer.ever_connected, - timeout=10, lock=p2p_lock) - self.wait_until(lambda: no_verack_idle_peer.version_received, - timeout=10, lock=p2p_lock) + check_connected=False) + no_version_idle_peer.wait_until( + lambda: no_version_idle_peer.ever_connected) + no_verack_idle_peer.wait_until( + lambda: no_verack_idle_peer.version_received) # Mine a block and make sure that it's not sent to the connected peers self.nodes[0].generate(nblocks=1) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -609,8 +609,8 @@ self.sync_blocks(nodes) self.sync_mempools(nodes) - def wait_until(self, test_function, timeout=60, lock=None): - return wait_until_helper(test_function, timeout=timeout, lock=lock, + def wait_until(self, test_function, timeout=60): + return wait_until_helper(test_function, timeout=timeout, timeout_factor=self.options.timeout_factor) # Private helper methods. These should not be accessed by the subclass