Skip to content

Commit 9cb68fa

Browse files
committed
test: Fix intermittent failure in p2p_v2_misbehaving.py
The ellswift bytes are computed in the NetworkThread and sent in the MainThread. Add a `wait_until()` to make sure that ellswift computation is completed in NetworkThread before sending it in the MainThread.
1 parent 9adebe1 commit 9cb68fa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/functional/p2p_v2_misbehaving.py

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def test_earlykeyresponse(self):
143143
self.log.info('Sending remaining ellswift and garbage which are different from V1_PREFIX. Since a response is')
144144
self.log.info('expected now, our custom data_received() function wouldn\'t result in assertion failure')
145145
peer1.v2_state.can_data_be_received = True
146+
self.wait_until(lambda: peer1.v2_state.ellswift_ours)
146147
peer1.send_raw_message(peer1.v2_state.ellswift_ours[4:] + peer1.v2_state.sent_garbage)
147148
with node0.assert_debug_log(['V2 handshake timeout peer=0']):
148149
peer1.wait_for_disconnect(timeout=5)

0 commit comments

Comments
 (0)