Skip to content

Commit

Permalink
pytest: disable automatic reconnection.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rustyrussell committed Jan 20, 2022
1 parent 109b3e6 commit 3ccb3da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 3ccb3da

Please sign in to comment.