pytest: make wait_for do exponential backoff, start at 0.25 seconds.

This doesn't alter runtime very much, but does reduce log spam.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-10-10 09:41:55 +10:30
parent 84b9e3e72b
commit fcb5310873
3 changed files with 10 additions and 6 deletions

View File

@@ -764,10 +764,10 @@ def test_channel_persistence(node_factory, bitcoind, executor):
wait_for(lambda: len(l2.rpc.listpeers()['peers']) == 1)
# Wait for the restored HTLC to finish
wait_for(lambda: only_one(l1.rpc.listpeers()['peers'][0]['channels'])['msatoshi_to_us'] == 99990000, interval=1)
wait_for(lambda: only_one(l1.rpc.listpeers()['peers'][0]['channels'])['msatoshi_to_us'] == 99990000)
wait_for(lambda: len([p for p in l1.rpc.listpeers()['peers'] if p['connected']]), interval=1)
wait_for(lambda: len([p for p in l2.rpc.listpeers()['peers'] if p['connected']]), interval=1)
wait_for(lambda: len([p for p in l1.rpc.listpeers()['peers'] if p['connected']]))
wait_for(lambda: len([p for p in l2.rpc.listpeers()['peers'] if p['connected']]))
# Now make sure this is really functional by sending a payment
l1.pay(l2, 10000)