Skip to content

Commit

Permalink
Increase timeout waiting for the machine to delete
Browse files Browse the repository at this point in the history
Signed-off-by: Itzhak Kave <ikave@ibm.com>
  • Loading branch information
Itzhak Kave committed Oct 30, 2024
1 parent aeeaee7 commit c9ee861
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ocs_ci/ocs/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ def get_machines(machine_type=constants.WORKER_MACHINE):
return machines


def delete_machine(machine_name):
def delete_machine(machine_name, timeout=600):
"""
Deletes a machine
Args:
machine_name (str): Name of the machine you want to delete
timeout (int): Time to wait for the machine to be deleted
Raises:
CommandFailed: In case yaml_file and resource_name wasn't provided
Expand All @@ -107,7 +108,7 @@ def delete_machine(machine_name):
kind="machine", namespace=constants.OPENSHIFT_MACHINE_API_NAMESPACE
)
log.info(f"Deleting machine {machine_name}")
machine_obj.delete(resource_name=machine_name)
machine_obj.delete(resource_name=machine_name, timeout=timeout)


def get_machine_type(machine_name):
Expand Down Expand Up @@ -167,7 +168,7 @@ def delete_machine_and_check_state_of_new_spinned_machine(machine_name):
machine_type = get_machine_type(machine_name)
machine_list = get_machines(machine_type=machine_type)
initial_machine_names = [machine.name for machine in machine_list]
delete_machine(machine_name)
delete_machine(machine_name, timeout=900)
new_machine_list = get_machines(machine_type=machine_type)
new_machine = [
machine
Expand Down

0 comments on commit c9ee861

Please sign in to comment.