From 3d2af2237cf7d5c941738bbcabcc46c033c6c4e9 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 22 May 2019 10:50:23 +0930 Subject: [PATCH] pytest: fix test_htlc_send_timeout now pay doesn't return ROUTE_NOT_FOUND. This brings up an interesting quirk though, in that we report "3 attempts", where we really should have done one. Signed-off-by: Rusty Russell --- tests/test_misc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_misc.py b/tests/test_misc.py index c0a8608c5..9fba052bf 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1003,14 +1003,14 @@ def test_htlc_send_timeout(node_factory, bitcoind): timedout = True inv = l3.rpc.invoice(123000, 'test_htlc_send_timeout', 'description') - with pytest.raises(RpcError) as excinfo: + with pytest.raises(RpcError, match=r'Ran out of routes to try after [0-9] attempts') as excinfo: l1.rpc.pay(inv['bolt11']) err = excinfo.value - # Complaints it couldn't find route. + # Complains it stopped after several attempts. # FIXME: include in pylightning - PAY_ROUTE_NOT_FOUND = 205 - assert err.error['code'] == PAY_ROUTE_NOT_FOUND + PAY_STOPPED_RETRYING = 210 + assert err.error['code'] == PAY_STOPPED_RETRYING status = only_one(l1.rpc.call('paystatus')['pay'])