From de238ccaea93875a955ceac882987dd4847ebc86 Mon Sep 17 00:00:00 2001 From: Michael Engel Date: Fri, 13 Dec 2024 11:52:17 +0100 Subject: [PATCH] Fix flacky node is online subtest Signed-off-by: Michael Engel --- .../python/is_node_connected.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/tests/tier0/bluechi-controller-socket-activation/python/is_node_connected.py b/tests/tests/tier0/bluechi-controller-socket-activation/python/is_node_connected.py index b27e170b6b..0645f9f5b6 100644 --- a/tests/tests/tier0/bluechi-controller-socket-activation/python/is_node_connected.py +++ b/tests/tests/tier0/bluechi-controller-socket-activation/python/is_node_connected.py @@ -15,11 +15,15 @@ class TestNodeIsConnected(unittest.TestCase): def test_node_is_connected(self): - n = Node(NODE_NAME) with Timeout(5, f"Timeout while waiting for agent '{NODE_NAME}' to be online"): - while n.status != "online": - time.sleep(0.5) + status = "offline" + while status != "online": + try: + status = Node(NODE_NAME).status + time.sleep(0.5) + except Exception: + pass if __name__ == "__main__":