Skip to content

Commit e6f4614

Browse files
committed
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.
1 parent 6f9db1e commit e6f4614

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/functional/p2p_v2_misbehaving.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ def test_earlykeyresponse(self):
147147
peer1.v2_state.can_data_be_received = True
148148
self.wait_until(lambda: peer1.v2_state.ellswift_ours)
149149
peer1.send_raw_message(peer1.v2_state.ellswift_ours[4:] + peer1.v2_state.sent_garbage)
150-
node0.bumpmocktime(3)
151150
# Ensure that the bytes sent after 4 bytes network magic are actually received.
152151
self.wait_until(lambda: node0.getpeerinfo()[-1]["bytesrecv"] > 4)
152+
self.wait_until(lambda: node0.getpeerinfo()[-1]["bytessent"] > 0)
153+
node0.bumpmocktime(3)
153154
with node0.assert_debug_log(['V2 handshake timeout peer=0']):
154155
node0.bumpmocktime(1) # `InactivityCheck()` triggers now
155156
peer1.wait_for_disconnect(timeout=1)

0 commit comments

Comments
 (0)