From e633ecf3af73c700f77fe74a6f812bfc9e64c317 Mon Sep 17 00:00:00 2001 From: Yang Chiu Date: Tue, 14 Nov 2023 10:44:04 +0800 Subject: [PATCH] test(negative): force stop instances to simulate hard shutdown Signed-off-by: Yang Chiu --- e2e/libs/node/node.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/libs/node/node.py b/e2e/libs/node/node.py index 663a6e58b8..4938a473ad 100644 --- a/e2e/libs/node/node.py +++ b/e2e/libs/node/node.py @@ -20,7 +20,7 @@ def __init__(self): def reboot_all_nodes(self, shut_down_time_in_sec=60): instance_ids = [value for value in self.mapping.values()] - resp = self.aws_client.stop_instances(InstanceIds=instance_ids) + resp = self.aws_client.stop_instances(InstanceIds=instance_ids, Force=True) logging(f"Stopping instances {instance_ids} response: {resp}") waiter = self.aws_client.get_waiter('instance_stopped') waiter.wait(InstanceIds=instance_ids) @@ -38,7 +38,7 @@ def reboot_all_nodes(self, shut_down_time_in_sec=60): def reboot_node(self, reboot_node_name, shut_down_time_in_sec=60): instance_ids = [self.mapping[reboot_node_name]] - resp = self.aws_client.stop_instances(InstanceIds=instance_ids) + resp = self.aws_client.stop_instances(InstanceIds=instance_ids, Force=True) logging(f"Stopping instances {instance_ids} response: {resp}") waiter = self.aws_client.get_waiter('instance_stopped') waiter.wait(InstanceIds=instance_ids) @@ -55,7 +55,7 @@ def reboot_node(self, reboot_node_name, shut_down_time_in_sec=60): def reboot_all_worker_nodes(self, shut_down_time_in_sec=60): instance_ids = [self.mapping[value] for value in list_node_names_by_role("worker")] - resp = self.aws_client.stop_instances(InstanceIds=instance_ids) + resp = self.aws_client.stop_instances(InstanceIds=instance_ids, Force=True) logging(f"Stopping instances {instance_ids} response: {resp}") waiter = self.aws_client.get_waiter('instance_stopped') waiter.wait(InstanceIds=instance_ids)