Skip to content

Commit

Permalink
pytest: fix flake in tests/test_closing.py::test_closing_specified_de…
Browse files Browse the repository at this point in the history
…stination

The close call can fail, since we already unilaterally closed since we mined blocks
too fast:

```
2023-01-14T01:00:10.2502199Z E           pyln.client.lightning.RpcError: RPC call failed: method: close, payload: ['107x1x1', None, 'bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg'], error: {'code': -32602, 'message': "Short channel ID not active: '107x1x1'"}
...
2023-01-14T01:00:10.5288050Z lightningd-4 2023-01-14T00:59:59.650Z UNUSUAL 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-chan#1: Peer permanent failure in CHANNELD_NORMAL: Fulfilled HTLC 0 SENT_REMOVE_COMMIT cltv 113 hit deadline
```

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Jan 14, 2023
1 parent c530b3d commit 48661a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ def test_closing_specified_destination(node_factory, bitcoind, chainparams):
l1.pay(l3, 100000000)
l1.pay(l4, 100000000)

# Make sure HTLCs completely expired before we mine, so they don't
# unilaterally close!
for n in l1, l2, l3, l4:
wait_for(lambda: all(c['htlcs'] == [] for c in n.rpc.listpeerchannels()['channels']))

mine_funding_to_announce(bitcoind, [l1, l2, l3, l4])

addr = chainparams['example_addr']
Expand Down

0 comments on commit 48661a3

Please sign in to comment.