0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

test: Fix p2p_leak.py intermittent failure by lowering timeout

This commit is contained in:
Martin Zumsande 2021-06-04 21:37:24 +02:00
parent 346e52afd6
commit ca3a77068b

View file

@ -29,6 +29,8 @@ from test_framework.util import (
assert_greater_than_or_equal,
)
PEER_TIMEOUT = 3
class LazyPeer(P2PInterface):
def __init__(self):
@ -98,7 +100,7 @@ class P2PVersionStore(P2PInterface):
class P2PLeakTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.extra_args = [['-peertimeout=4']]
self.extra_args = [[f"-peertimeout={PEER_TIMEOUT}"]]
def create_old_version(self, nversion):
old_version_msg = msg_version()
@ -134,7 +136,7 @@ class P2PLeakTest(BitcoinTestFramework):
self.nodes[0].generate(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