mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
pytest: fix reconnect flake in test_plugin_connected_hook_chaining
```
l1.rpc.reject(l3.info['id'])
l2.connect(l1)
l1.daemon.wait_for_logs([
f"peer_connected_logger_a {l2id}",
f"{l2id} is allowed",
f"peer_connected_logger_b {l2id}"
])
assert len(l1.rpc.listpeers(l2id)['peers']) == 1
> l3.connect(l1)
tests/test_plugin.py:468:
...
> raise RpcError(method, payload, resp['error'])
E pyln.client.lightning.RpcError: RPC call failed: method: connect, payload: {'id': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518', 'host': '127.0.0.1', 'port': 42391}, error: {'code': 402, 'message': 'disconnected during connection'}
contrib/pyln-client/pyln/client/lightning.py:422: RpcError
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -465,7 +465,13 @@ def test_plugin_connected_hook_chaining(node_factory):
|
|||||||
])
|
])
|
||||||
assert len(l1.rpc.listpeers(l2id)['peers']) == 1
|
assert len(l1.rpc.listpeers(l2id)['peers']) == 1
|
||||||
|
|
||||||
l3.connect(l1)
|
# If reject happens fast enough, connect fails with "disconnected
|
||||||
|
# during connection"
|
||||||
|
try:
|
||||||
|
l3.connect(l1)
|
||||||
|
except RpcError as err:
|
||||||
|
assert "disconnected during connection" in err.error
|
||||||
|
|
||||||
l1.daemon.wait_for_logs([
|
l1.daemon.wait_for_logs([
|
||||||
f"peer_connected_logger_a {l3id}",
|
f"peer_connected_logger_a {l3id}",
|
||||||
f"{l3id} is in reject list"
|
f"{l3id} is in reject list"
|
||||||
|
|||||||
Reference in New Issue
Block a user