From 2e28226e1847c1aa45d938c59bb21bdeacd4aaeb Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 21 Jul 2023 14:52:33 +0930 Subject: [PATCH] pytest: fix timeout in test_channel_lease_unilat_closes Sometimes syncing 4032 blocks can take too long: ``` # This can timeout, so do it in easy stages. for i in range(16): bitcoind.generate_block(4032 // 16) > sync_blockheight(bitcoind, [l2, l3]) tests/test_closing.py:996: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ contrib/pyln-testing/pyln/testing/utils.py:135: in sync_blockheight wait_for(lambda: n.rpc.getinfo()['blockheight'] == height) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ success = . at 0x7ffb00227670> timeout = 180 def wait_for(success, timeout=TIMEOUT): start_time = time.time() interval = 0.25 while not success(): time_left = start_time + timeout - time.time() if time_left <= 0: > raise ValueError("Timeout while waiting for {}".format(success)) E ValueError: Timeout while waiting for . at 0x7ffb00227670> ``` Signed-off-by: Rusty Russell --- tests/test_closing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_closing.py b/tests/test_closing.py index fac3d3280..27fac5b5b 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -993,7 +993,7 @@ def test_channel_lease_unilat_closes(node_factory, bitcoind): # This can timeout, so do it in easy stages. for i in range(16): bitcoind.generate_block(4032 // 16) - sync_blockheight(bitcoind, [l2, l3]) + sync_blockheight(bitcoind, [l2, l3]) l2.rpc.withdraw(l2.rpc.newaddr()['bech32'], "all", utxos=[utxo1])