aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_v2_misbehaving.py
diff options
context:
space:
mode:
authorstratospher <44024636+stratospher@users.noreply.github.com>2024-07-17 15:55:14 +0530
committerstratospher <44024636+stratospher@users.noreply.github.com>2024-07-17 17:56:19 +0530
commitc322bddd08ed1f1f7f0c39768b659dd62d5e2dd5 (patch)
tree581722548ffecfbacabb1a7d3f346261a0b37d93 /test/functional/p2p_v2_misbehaving.py
parent6f9db1ebcab4064065ccd787161bf2b87e03cc1f (diff)
test: bump mocktime after node has received and sent bytes
a different error message "socket no message in first %i seconds" will be displayed if m_last_send=0 or if m_last_recv is 0. make the test robust by ensuring that they will not be 0 before bumping mocktime.
Diffstat (limited to 'test/functional/p2p_v2_misbehaving.py')
-rwxr-xr-xtest/functional/p2p_v2_misbehaving.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/p2p_v2_misbehaving.py b/test/functional/p2p_v2_misbehaving.py
index 9017ee9455..0789425bcb 100755
--- a/test/functional/p2p_v2_misbehaving.py
+++ b/test/functional/p2p_v2_misbehaving.py
@@ -147,11 +147,11 @@ class EncryptedP2PMisbehaving(BitcoinTestFramework):
peer1.v2_state.can_data_be_received = True
self.wait_until(lambda: peer1.v2_state.ellswift_ours)
peer1.send_raw_message(peer1.v2_state.ellswift_ours[4:] + peer1.v2_state.sent_garbage)
- node0.bumpmocktime(3)
# Ensure that the bytes sent after 4 bytes network magic are actually received.
self.wait_until(lambda: node0.getpeerinfo()[-1]["bytesrecv"] > 4)
+ self.wait_until(lambda: node0.getpeerinfo()[-1]["bytessent"] > 0)
with node0.assert_debug_log(['V2 handshake timeout peer=0']):
- node0.bumpmocktime(1) # `InactivityCheck()` triggers now
+ node0.bumpmocktime(4) # `InactivityCheck()` triggers now
peer1.wait_for_disconnect(timeout=1)
self.log.info('successful disconnection since modified ellswift was sent as response')