pytest: try to prevent spurious timeouts in test_channel_lease_unilat_closes

Generating 4032 blocks takes a while, so do it in four parts.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-08-15 20:24:13 +09:30
committed by Christian Decker
parent 2b07d0b0e6
commit aedea77ec7

View File

@@ -932,7 +932,9 @@ def test_channel_lease_unilat_closes(node_factory, bitcoind):
# we *can* spend the 1csv lock one # we *can* spend the 1csv lock one
l2.rpc.withdraw(l2.rpc.newaddr()['bech32'], "all", utxos=[utxo3]) l2.rpc.withdraw(l2.rpc.newaddr()['bech32'], "all", utxos=[utxo3])
bitcoind.generate_block(4032) # This can timeout, so do it in four easy stages.
for i in range(4):
bitcoind.generate_block(4032 // 4)
sync_blockheight(bitcoind, [l2, l3]) sync_blockheight(bitcoind, [l2, l3])
l2.rpc.withdraw(l2.rpc.newaddr()['bech32'], "all", utxos=[utxo1]) l2.rpc.withdraw(l2.rpc.newaddr()['bech32'], "all", utxos=[utxo1])