From 3ccb3da2c551c0bc13e388bbfb6170032efb5c08 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 11 Jan 2022 16:24:11 +1030 Subject: [PATCH] pytest: disable automatic reconnection. We seem to hit a race between manual reconnect (with address hint) and an automatic reconnection attempt which fails: ``` > l4.rpc.connect(l3.info['id'], 'localhost', l3.port) ... E pyln.client.lightning.RpcError: RPC call failed: method: connect, payload: {'id': '035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d', 'host': 'localhost', 'port': 41285}, error: {'code': 401, 'message': 'All addresses failed: 127.0.0.1:36678: Connection establishment: Connection refused. '} ``` See how it didn't even try the given address? Signed-off-by: Rusty Russell --- tests/test_pay.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_pay.py b/tests/test_pay.py index 569b56f7b..7dc898b45 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -4348,7 +4348,8 @@ def test_offer(node_factory, bitcoind): def test_fetchinvoice_3hop(node_factory, bitcoind): l1, l2, l3, l4 = node_factory.line_graph(4, wait_for_announce=True, opts={'experimental-offers': None, - 'may_reconnect': True}) + 'may_reconnect': True, + 'dev-no-reconnect': None}) offer1 = l4.rpc.call('offer', {'amount': '2msat', 'description': 'simple test'}) assert offer1['created'] is True @@ -4999,7 +5000,8 @@ def test_sendpay_grouping(node_factory, bitcoind): invoices = l3.rpc.listinvoices()['invoices'] assert(len(invoices) == 1) assert(invoices[0]['status'] == 'unpaid') - l3.connect(l2) + # Will reconnect automatically + wait_for(lambda: only_one(l3.rpc.listpeers()['peers'])['connected'] is True) scid = l3.rpc.listpeers()['peers'][0]['channels'][0]['short_channel_id'] wait_for(lambda: [c['active'] for c in l1.rpc.listchannels(scid)['channels']] == [True, True]) l1.rpc.pay(inv, msatoshi='420000msat')