pytest: test_pay flake fix.

This is almost certainly because the HTLCs are not fully settled, so wait for that:

```
2023-06-20T11:37:56.2332158Z         assert apys_2[0]['our_start_balance_msat'] == Millisatoshi(0)
2023-06-20T11:37:56.2332443Z >       assert apys_1[0]['routed_out_msat'] == apys_2[0]['routed_in_msat']
2023-06-20T11:37:56.2332571Z E       assert 1892216msat == 2810170msat
2023-06-20T11:37:56.2332580Z 
2023-06-20T11:37:56.2332717Z tests/test_pay.py:81: AssertionError
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-06-21 11:46:19 +09:30
parent 35011337eb
commit 6287f3e3b1
2 changed files with 4 additions and 1 deletions

View File

@ -3437,7 +3437,7 @@ def test_setconfig(node_factory, bitcoind):
l1.fundchannel(l2, 10**6)
txid = l1.rpc.close(l2.info['id'])['txid']
# Make sure we're completely closed!
# Make sure we're completely closed!
bitcoind.generate_block(1, wait_for_mempool=txid)
sync_blockheight(bitcoind, [l1, l2])

View File

@ -71,6 +71,9 @@ def test_pay(node_factory):
payments = l1.rpc.listsendpays(inv)['payments']
assert len(payments) == 1 and payments[0]['payment_preimage'] == preimage
# Make sure they're completely settled, so accounting correct.
wait_for(lambda: only_one(l1.rpc.listpeerchannels()['channels'])['htlcs'] == [])
# Check channels apy summary view of channel activity
apys_1 = l1.rpc.bkpr_channelsapy()['channels_apy']
apys_2 = l2.rpc.bkpr_channelsapy()['channels_apy']