From f7b227244aa7bcf7a1e77854553a082d1884afa1 Mon Sep 17 00:00:00 2001 From: Michael Engel Date: Fri, 15 Dec 2023 14:23:56 +0100 Subject: [PATCH] wait a bit after controller has stopped Relates to: https://github.com/eclipse-bluechi/bluechi/issues/668 By waiting a bit, e.g. 1s, after the controller has stopped the agent will fail to reconnect at least one time - testing the perpetual retry to connect to the controller again. Signed-off-by: Michael Engel --- .../monitor-node-reconnect/test_monitor_node_reconnect.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/tests/tier0/monitor-node-reconnect/test_monitor_node_reconnect.py b/tests/tests/tier0/monitor-node-reconnect/test_monitor_node_reconnect.py index a95008d339..00f656daa5 100644 --- a/tests/tests/tier0/monitor-node-reconnect/test_monitor_node_reconnect.py +++ b/tests/tests/tier0/monitor-node-reconnect/test_monitor_node_reconnect.py @@ -20,6 +20,9 @@ def exec(ctrl: BluechiControllerContainer, nodes: Dict[str, BluechiNodeContainer ctrl.exec_run("systemctl stop bluechi-controller") ctrl.wait_for_unit_state_to_be('bluechi-controller', 'inactive') + # lets wait a bit so the agent has at least one failing reconnect attempt + time.sleep(1) + ctrl.exec_run("systemctl start bluechi-controller") ctrl.wait_for_bluechi() # since the heartbeat (incl. a try to reconnect) is going to happen