Browse Source

pytest: fix pay flake.

We weren't waiting for the channel to get to normal state:

E           pyln.client.lightning.RpcError: RPC call failed: method: pay, payload: {'bolt11': 'lnbcrt20m1pszfpezpp549um3vuyt52rgea32g7u55a5fv29yv7t94cmr2f0vjgcc33m3dvqdqzdgxqyjw5qcqp9sp59vu4tat2n53ylzrgxa95s5wu2s885a9llud64c0f6gjqts7h6tks9qy9qsq7u0j3w2h3sxxp9axpjxkz525znjn0t92gnrgk7y6plyq39zw9994g88xxjx52egk4965dp5qt2w08hk009eq9hm8nykwmxe7r705k8gpkqu9mw'}, error: {'code': 210, 'message': 'Ran out of routes to try after 1 attempt: see `paystatus`', 'attempts': [{'status': 'failed', 'failreason': 'Cannot attempt payment, we have no channel to which we can add an HTLC', 'partid': 1, 'amount': '2000000000msat'}]}

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
master
Rusty Russell 4 years ago
committed by Christian Decker
parent
commit
c397efee1c
  1. 1
      tests/test_pay.py

1
tests/test_pay.py

@ -3300,6 +3300,7 @@ def test_bolt11_null_after_pay(node_factory, bitcoind):
# Let the channel confirm.
bitcoind.generate_block(6)
sync_blockheight(bitcoind, [l1, l2])
wait_for(lambda: only_one(only_one(l1.rpc.listpeers()['peers'])['channels'])['state'] == 'CHANNELD_NORMAL')
amt = Millisatoshi(amount_sat * 2 * 1000)
invl1 = l1.rpc.invoice(amt, 'j', 'j')['bolt11']

Loading…
Cancel
Save