From 7f371e98e5c7e1406eecf36ee6c6d5782a21fe5a Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 26 Sep 2024 09:22:54 +0800 Subject: [PATCH] minor fix --- e2e/keywords/k8s.resource | 8 -------- e2e/libs/k8s/k8s.py | 8 -------- e2e/libs/utility/utility.py | 22 ---------------------- 3 files changed, 38 deletions(-) diff --git a/e2e/keywords/k8s.resource b/e2e/keywords/k8s.resource index a0519cb479..d85caf8c1f 100644 --- a/e2e/keywords/k8s.resource +++ b/e2e/keywords/k8s.resource @@ -101,14 +101,6 @@ Force drain node ${node_id} and expect success Set Test Variable ${instance_manager_name} Set Test Variable ${drained_node} -#Force drain node ${node_id} and wait for ${duration} second -# ${drained_node} = get_node_by_index ${node_id} -# ${instance_manager_name} = get_instance_manager_on_node ${drained_node} -# ${drain_process} = force_drain_node_and_wait ${drained_node} ${duration} -# Set Test Variable ${drain_process} -# Set Test Variable ${instance_manager_name} -# Set Test Variable ${drained_node} - The drain process not completed check_drain_process_not_completed ${drain_process} diff --git a/e2e/libs/k8s/k8s.py b/e2e/libs/k8s/k8s.py index bdaac74ea5..3002c83e5f 100644 --- a/e2e/libs/k8s/k8s.py +++ b/e2e/libs/k8s/k8s.py @@ -10,8 +10,6 @@ from utility.utility import subprocess_exec_cmd from utility.utility import logging from utility.utility import get_retry_count_and_interval -from utility.utility import check_popen_process_not_completed -from utility.utility import check_popen_process_completed from utility.utility import subprocess_exec_cmd_with_timeout from robot.libraries.BuiltIn import BuiltIn @@ -82,12 +80,6 @@ def check_node_cordoned(node_name): node = api.read_node(node_name) assert node.spec.unschedulable is True, f"node {node_name} is not cordoned." -def check_drain_process_not_completed(drain_process): - check_popen_process_not_completed(drain_process) - -def check_drain_process_completed(drain_process): - check_popen_process_completed(drain_process) - def get_instance_manager_on_node(node_name): data_engine = BuiltIn().get_variable_value("${DATA_ENGINE}") pods = get_all_pods_on_node(node_name) diff --git a/e2e/libs/utility/utility.py b/e2e/libs/utility/utility.py index 2381ded36c..1aa95847f2 100644 --- a/e2e/libs/utility/utility.py +++ b/e2e/libs/utility/utility.py @@ -289,25 +289,3 @@ def get_name_suffix(*args): if arg: suffix += f"-{arg}" return suffix - - -def check_popen_process_not_completed(process): - assert process.poll() is None, f"process {process} terminated which is not expected." - - -def check_popen_process_completed(process): - retry_count, retry_interval = get_retry_count_and_interval() - for i in range(retry_count): - if process.poll() is not None: - return - time.sleep(retry_interval) - assert process.poll() is not None, f"process {process} not terminated which is not expected." - - -def get_popen_process_error_log(drain_process): - if drain_process.poll() is None: - drain_process.terminate() - - stdout, stderr = drain_process.communicate() - logging(f"{stderr.decode('utf-8')}") - return stderr.decode('utf-8')