From cb3ebf5d3059ffa413ec886a39a40f668f754622 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 fc779f2b410..2e60cb59998 100644 --- a/ocs_ci/ocs/node.py +++ b/ocs_ci/ocs/node.py @@ -1051,9 +1051,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,