The test fails intermittently, see https://cirrus-ci.com/task/6403578080788480?logs=ci#L3521 and #24748 (comment).
I think it’s because of a race between the python NetworkThread and the actual
test, which will both call initiate_v2_handshake. I could reproduce it by adding a sleep into initiate_v2_handshake after the line self.sent_garbage = random.randbytes(garbage_len).
Fix this by waiting for the first initiate_v2_handshake to have finished before calling it a second time.