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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-07-21 15:46:54 +09:30
parent 36b323e6d2
commit 6a7a0ea7d0

View file

@ -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')