Skip to content

Commit

Permalink
testing: fix flake in test_ping_timeout
Browse files Browse the repository at this point in the history
[ Folded 2 fixups --RR ]
  • Loading branch information
SimonVrouwe authored and rustyrussell committed Feb 28, 2022
1 parent c286eb0 commit 175e0b5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3702,6 +3702,7 @@ def test_ping_timeout(node_factory):
'disconnect': l1_disconnects},
{}])
# Takes 15-45 seconds, then another to try second ping
l1.daemon.wait_for_log('Last ping unreturned: hanging up',
timeout=45 + 45 + 5)
wait_for(lambda: l1.rpc.getpeer(l2.info['id'])['connected'] is False)
# Because of ping timer randomness we don't know which side hangs up first
wait_for(lambda: l1.rpc.getpeer(l2.info['id'])['connected'] is False, timeout=45 + 45 + 5)
wait_for(lambda: (l1.daemon.is_in_log('Last ping unreturned: hanging up')
or l2.daemon.is_in_log('Last ping unreturned: hanging up')))

0 comments on commit 175e0b5

Please sign in to comment.