Skip to content

Commit

Permalink
test(negative): force stop instances to simulate hard shutdown
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Chiu <[email protected]>
  • Loading branch information
yangchiu authored and David Ko committed Nov 17, 2023
1 parent 6f54a43 commit e633ecf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions e2e/libs/node/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit e633ecf

Please sign in to comment.