Skip to content

Commit

Permalink
test: bump mocktime after node has received and sent bytes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stratospher committed Jul 17, 2024
1 parent 6f9db1e commit e6f4614
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/functional/p2p_v2_misbehaving.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ def test_earlykeyresponse(self):
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)
node0.bumpmocktime(3)
with node0.assert_debug_log(['V2 handshake timeout peer=0']):
node0.bumpmocktime(1) # `InactivityCheck()` triggers now
peer1.wait_for_disconnect(timeout=1)
Expand Down

0 comments on commit e6f4614

Please sign in to comment.