Skip to content

Commit b5845af

Browse files
committed
pytest: fix another flake in test_restorefrompeer.
Signed-off-by: Rusty Russell <[email protected]>
1 parent 71adecc commit b5845af

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_misc.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2694,7 +2694,13 @@ def test_restorefrompeer(node_factory, bitcoind):
26942694
l1.start()
26952695
assert l1.daemon.is_in_log('Server started with public key')
26962696

2697-
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
2697+
# If this happens fast enough, connect fails with "disconnected
2698+
# during connection"
2699+
try:
2700+
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
2701+
except RpcError as err:
2702+
assert "disconnected during connection" in err.error
2703+
26982704
l1.daemon.wait_for_log('peer_in WIRE_YOUR_PEER_STORAGE')
26992705

27002706
assert l1.rpc.restorefrompeer()['stubs'][0] == _['channel_id']

0 commit comments

Comments
 (0)