diff --git a/test/functional/p2p_leak.py b/test/functional/p2p_leak.py index d966537631..9824586c42 100755 --- a/test/functional/p2p_leak.py +++ b/test/functional/p2p_leak.py @@ -30,6 +30,8 @@ from test_framework.util import ( assert_greater_than_or_equal, ) +PEER_TIMEOUT = 3 + class LazyPeer(P2PInterface): def __init__(self): @@ -97,6 +99,8 @@ class P2PLeakTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 self.disable_mocktime = True + self.extra_args = [[f"-peertimeout={PEER_TIMEOUT}"]] + def create_old_version(self, nversion): old_version_msg = msg_version() @@ -126,7 +130,7 @@ class P2PLeakTest(BitcoinTestFramework): self.generate(self.nodes[0], nblocks=1) # Give the node enough time to possibly leak out a message - time.sleep(5) + time.sleep(PEER_TIMEOUT + 2) # Make sure only expected messages came in assert not no_version_idle_peer.unexpected_msg