Skip to content

Commit ca3a770

Browse files
committed
test: Fix p2p_leak.py intermittent failure by lowering timeout
1 parent 346e52a commit ca3a770

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/functional/p2p_leak.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
assert_greater_than_or_equal,
3030
)
3131

32+
PEER_TIMEOUT = 3
33+
3234

3335
class LazyPeer(P2PInterface):
3436
def __init__(self):
@@ -98,7 +100,7 @@ def on_version(self, msg):
98100
class P2PLeakTest(BitcoinTestFramework):
99101
def set_test_params(self):
100102
self.num_nodes = 1
101-
self.extra_args = [['-peertimeout=4']]
103+
self.extra_args = [[f"-peertimeout={PEER_TIMEOUT}"]]
102104

103105
def create_old_version(self, nversion):
104106
old_version_msg = msg_version()
@@ -134,7 +136,7 @@ def run_test(self):
134136
self.nodes[0].generate(nblocks=1)
135137

136138
# Give the node enough time to possibly leak out a message
137-
time.sleep(5)
139+
time.sleep(PEER_TIMEOUT + 2)
138140

139141
# Make sure only expected messages came in
140142
assert not no_version_idle_peer.unexpected_msg

0 commit comments

Comments
 (0)