Skip to content

Commit

Permalink
Do not fail test when it's impossible to remove namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
tellet authored and Dean-Coakley committed Jan 10, 2020
1 parent b54aca6 commit ec2eb75
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/suite/resources_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,11 @@ def ensure_item_removal(get_item, *args, **kwargs) -> None:
get_item(*args, **kwargs)
counter = counter + 1
if counter >= 30:
pytest.fail("Failed to remove the item after 30 seconds")
# Due to k8s issue with namespaces, they sometimes stuck in Terminating state, skip such cases
if "namespace" in str(get_item):
print(f"Failed to remove namespace '{args}' after 30 seconds, skip removal. Remove manually.")
else:
pytest.fail("Failed to remove the item after 30 seconds")
except ApiException as ex:
if ex.status == 404:
print("Item was removed")
Expand Down

0 comments on commit ec2eb75

Please sign in to comment.