From c397efee1c71b563f22e1917ba29cbfbf811bfb0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 11 Feb 2021 11:57:58 +1030 Subject: [PATCH] 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 --- tests/test_pay.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_pay.py b/tests/test_pay.py index 3249e8d0c..c7a110bdd 100644 --- a/tests/test_pay.py +++ b/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']