From 78bed5fde9ac386a878cbf0c78cc92e6502591f1 Mon Sep 17 00:00:00 2001 From: "Madhusudan.C.S" Date: Wed, 8 Feb 2017 00:26:53 -0800 Subject: [PATCH] [Federation] Wait after cleanup only if the cleanup succeeds. It is a waste of time to wait for the resources to cleanup if the cleanup fails. --- hack/e2e-internal/e2e-down.sh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/hack/e2e-internal/e2e-down.sh b/hack/e2e-internal/e2e-down.sh index dea0724b68..9d07be9b49 100755 --- a/hack/e2e-internal/e2e-down.sh +++ b/hack/e2e-internal/e2e-down.sh @@ -32,24 +32,28 @@ prepare-e2e if [[ "${FEDERATION:-}" == "true" ]];then source "${KUBE_ROOT}/federation/cluster/common.sh" - cleanup-federation-api-objects || echo "Couldn't cleanup federation api objects" + if cleanup-federation-api-objects; then + # TODO(madhusudancs): This is an arbitrary amount of sleep to give + # Kubernetes clusters enough time to delete the underlying cloud + # provider resources corresponding to the Kubernetes resources we + # deleted as part of the test tear downs. It is shameful that we + # are doing this, but this is just a bandage to stop the bleeding. + # Please don't use this pattern anywhere. Remove this when proper + # cloud provider cleanups are implemented in the individual test + # `AfterEach` blocks. + # Also, we wait only if the cleanup succeeds. + sleep 2m + else + echo "Couldn't cleanup federation api objects" + fi - # TODO(madhusudancs): This is an arbitrary amount of sleep to give Kubernetes - # clusters enough time to delete the underlying cloud provider resources - # corresponding to the Kubernetes resources we deleted as part of the test - # teardowns. It is shameful that we are doing this, but this is just a bandage - # to stop the bleeding. Please don't use this pattern anywhere. Remove this - # when proper cloud provider cleanups are implemented in the individual test - # `AfterEach` blocks. - sleep 2m - - for zone in ${E2E_ZONES};do + for zone in ${E2E_ZONES}; do # bring down an e2e cluster ( set-federation-zone-vars "$zone" test-teardown ) -done + done else test-teardown fi