From b5845afd436a1b8d990bf574ee7af9097e1ad8f2 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 23 Jun 2023 13:21:28 +0930 Subject: [PATCH] pytest: fix another flake in test_restorefrompeer. Signed-off-by: Rusty Russell --- tests/test_misc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_misc.py b/tests/test_misc.py index be2cd4a42..4af456f78 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -2694,7 +2694,13 @@ def test_restorefrompeer(node_factory, bitcoind): l1.start() assert l1.daemon.is_in_log('Server started with public key') - l1.rpc.connect(l2.info['id'], 'localhost', l2.port) + # If this happens fast enough, connect fails with "disconnected + # during connection" + try: + l1.rpc.connect(l2.info['id'], 'localhost', l2.port) + except RpcError as err: + assert "disconnected during connection" in err.error + l1.daemon.wait_for_log('peer_in WIRE_YOUR_PEER_STORAGE') assert l1.rpc.restorefrompeer()['stubs'][0] == _['channel_id']