testing: fix flake in test_ping_timeout

[ Folded 2 fixups --RR ]
This commit is contained in:
Simon Vrouwe
2022-02-26 19:36:46 +02:00
committed by Rusty Russell
parent c286eb053f
commit 175e0b54b3

View File

@@ -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')))