pytest: fix flake in test_closing_simple when we mine too fast.

We can actually catch l2 with HTLCs still closing and mine blocks,
then it force closes due to HTLC timeout.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-02-01 12:29:32 +10:30 committed by Alex Myers
parent f87c7ed439
commit 38510202c4

View File

@ -46,6 +46,8 @@ def test_closing_simple(node_factory, bitcoind, chainparams):
# check for the substring
assert 'CHANNELD_NORMAL:Channel ready for use.' in billboard[0]
# Make sure all HTLCs resolved before we close!
wait_for(lambda: only_one(l2.rpc.listpeerchannels()['channels'])['htlcs'] == [])
l1.rpc.close(chan)
l1.daemon.wait_for_log(' to CHANNELD_SHUTTING_DOWN')