From 6a7a0ea7d01e2a71e41c381514378076b3a9d390 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 21 Jul 2023 15:46:54 +0930 Subject: [PATCH] pytest: fix flake handling intest_restorefrompeer. We tried to fix this flake before, but now it actually happened again it shows that b5845afd43 wasn't correct. ``` # 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 E assert 'disconnected during connection' in {'code': 402, 'message': 'disconnected during connection'} E + where {'code': 402, 'message': 'disconnected during connection'} = RpcError("RPC call failed: method: connect, payload: {'id': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59', 'host': 'localhost', 'port': 41849}, error: {'code': 402, 'message': 'disconnected during connection'}").error tests/test_misc.py:2728: AssertionError ``` Signed-off-by: Rusty Russell --- tests/test_misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_misc.py b/tests/test_misc.py index 70fafbdc5..8edb1082f 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -2725,7 +2725,7 @@ def test_restorefrompeer(node_factory, bitcoind): try: l1.rpc.connect(l2.info['id'], 'localhost', l2.port) except RpcError as err: - assert "disconnected during connection" in err.error + assert "disconnected during connection" in err.error['message'] l1.daemon.wait_for_log('peer_in WIRE_YOUR_PEER_STORAGE')