From 01e5f1886e31816e652f417a1ff789a26aaeec3b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 31 Mar 2022 19:40:50 +1030 Subject: [PATCH] pytest: fix flake in test_multichan. I have a separate branch which fixes this race properly, but it's not anything to do with this PR. Signed-off-by: Rusty Russell --- tests/test_connection.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index 4e5eb8be1..bc7855e97 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -3893,7 +3893,11 @@ def test_multichan(node_factory, executor, bitcoind): # Restart with multiple channels works. l3.restart() - l3.rpc.connect(l2.info['id'], 'localhost', l2.port) + # FIXME: race against autoconnect can cause spurious failure (but we connect!) + try: + l3.rpc.connect(l2.info['id'], 'localhost', l2.port) + except RpcError: + wait_for(lambda: only_one(l3.rpc.listpeers(l2.info['id'])['peers'])['connected']) inv = l3.rpc.invoice(100000000, "invoice4", "invoice4") l1.rpc.pay(inv['bolt11'])