From 3d4c111721ee060c84a56dca43af18ed899ddef7 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 20 Jan 2021 18:56:14 +0100 Subject: [PATCH] pytest: Stabilize test_multiple_channels If we're quick (or the node is slow) we end up reconnecting before our counterparty has realized the state transition, resulting in an unexpected re-establish. --- tests/test_connection.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_connection.py b/tests/test_connection.py index 253a8c9f4..da8cde8be 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -2071,6 +2071,12 @@ def test_multiple_channels(node_factory): l1.rpc.close(chan) + # If we don't wait for l2 to make the transition we can end up + # attempting to re-estabilishing the channel + l2.daemon.wait_for_log( + r'State changed from CLOSINGD_SIGEXCHANGE to CLOSINGD_COMPLETE' + ) + channels = only_one(l1.rpc.listpeers()['peers'])['channels'] assert len(channels) == 3 # Most in state ONCHAIN, last is CLOSINGD_COMPLETE