From 19f62a4d233bbd42ab6779fee3230acfd22d0c4c Mon Sep 17 00:00:00 2001 From: Daniel Osypenko Date: Wed, 18 Dec 2024 17:01:05 +0200 Subject: [PATCH] test_nodereplacement_proactive - fixed Signed-off-by: Daniel Osypenko --- ocs_ci/ocs/node.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ocs_ci/ocs/node.py b/ocs_ci/ocs/node.py index b458b29cb54..8d8326cf479 100644 --- a/ocs_ci/ocs/node.py +++ b/ocs_ci/ocs/node.py @@ -1031,9 +1031,15 @@ def delete_and_create_osd_node_managed_cp(osd_node_name): target_replicas=node_num_before_delete, timeout=machine_start_timeout ) - node_names_after_delete = get_node_names() - new_node_names = list(set(node_names_after_delete) - set(node_names_before_delete)) - new_node_name = new_node_names[0] + new_node_names = None + new_node_name = None + for sample in TimeoutSampler( + timeout=node_start_timeout, sleep=30, func=get_node_names + ): + if new_node_names := list(set(sample) - set(node_names_before_delete)): + new_node_name = new_node_names[0] + break + wait_for_nodes_status( node_names=new_node_names, status=constants.NODE_READY,