From d06c1871a962f3d90776f6c8b928500c12200d65 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 6 Feb 2023 15:06:29 +1030 Subject: [PATCH] pytest: fix flake in test_closing_disconnected_notify We might be disconnected, but the subd isn't dead yet: ``` > assert out[0] == '# peer is offline, will negotiate once they reconnect (5 seconds before unilateral close).' E AssertionError: assert '# Timed out, forcing close.' == ('# peer is offline, will negotiate once they reconnect (5 seconds before '\n 'unilateral close).') E - # peer is offline, will negotiate once they reconnect (5 seconds before unilateral close). E + # Timed out, forcing close. tests/test_closing.py:164: AssertionError ``` Signed-off-by: Rusty Russell --- tests/test_closing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_closing.py b/tests/test_closing.py index 3f81d8d47..462d86085 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -152,7 +152,8 @@ def test_closing_disconnected_notify(node_factory, bitcoind, executor): l1.pay(l2, 200000000) l2.stop() - wait_for(lambda: not only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['connected']) + # Wait until channeld is definitely gone. + wait_for(lambda: 'owner' not in only_one(l1.rpc.listpeerchannels()['channels'])) out = subprocess.check_output(['cli/lightning-cli', '--network={}'.format(TEST_NETWORK),