From 0db01c882f11de1f683ee1cf00e91c4f7fc5d725 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 21 Sep 2022 14:08:08 +0930 Subject: [PATCH] pytest: fix flake in test_sendcustommsg We assume that because we've told l3 to shut down, l2 already sees it as disconnected. But CI is ...slow... today! ``` # `l3` is disconnected and we can't send messages to it > assert(not l2.rpc.listpeers(l3.info['id'])['peers'][0]['connected']) E assert not True tests/test_misc.py:2218: 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 9b846347f..b77e9cbc0 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -2215,7 +2215,7 @@ def test_sendcustommsg(node_factory): l1.rpc.sendcustommsg(node_id, msg) # `l3` is disconnected and we can't send messages to it - assert(not l2.rpc.listpeers(l3.info['id'])['peers'][0]['connected']) + wait_for(lambda: l2.rpc.listpeers(l3.info['id'])['peers'][0]['connected'] is False) with pytest.raises(RpcError, match=r'Peer is not connected'): l2.rpc.sendcustommsg(l3.info['id'], msg)