Skip to content

Commit 9758b05

Browse files
committed
pytest: fix flake in test_penalty_htlc_tx_fulfill
Make sure balancing payment is fully cleared before trying to get a routeL ``` def test_penalty_htlc_tx_fulfill(node_factory, bitcoind, chainparams, anchors): # now we send one 'sticky' htlc: l4->l1 amt = 10**8 // 2 sticky_inv = l1.rpc.invoice(amt, '2', 'sticky') > route = l4.rpc.getroute(l1.info['id'], amt, 1)['route'] tests/test_closing.py:1232: > raise RpcError(method, payload, resp['error']) E pyln.client.lightning.RpcError: RPC call failed: method: getroute, payload: {'id': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518', 'amount_msat': 50000000, 'riskfactor': 1, 'cltv': 9}, error: {'code': 205, 'message': 'Could not find a route'} ```
1 parent 69bfa6f commit 9758b05

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/test_closing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,10 +1221,12 @@ def test_penalty_htlc_tx_fulfill(node_factory, bitcoind, chainparams, anchors):
12211221
inv = l2.rpc.invoice(10**9 // 2, '1', 'balancer')
12221222
l1.rpc.pay(inv['bolt11'])
12231223
l1.rpc.waitsendpay(inv['payment_hash'])
1224+
wait_for(lambda: only_one(l1.rpc.listpeerchannels()['channels'])['htlcs'] == [])
12241225

12251226
inv = l4.rpc.invoice(10**9 // 2, '1', 'balancer')
12261227
l2.rpc.pay(inv['bolt11'])
12271228
l2.rpc.waitsendpay(inv['payment_hash'])
1229+
wait_for(lambda: only_one(l1.rpc.listpeerchannels()['channels'])['htlcs'] == [])
12281230

12291231
# now we send one 'sticky' htlc: l4->l1
12301232
amt = 10**8 // 2

0 commit comments

Comments
 (0)