From bcd33e924905588b1bdecd5413dc7b268370ec4c Mon Sep 17 00:00:00 2001 From: Nick Tran <10810510+njtran@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:52:59 -0700 Subject: [PATCH] test: fix kind cluster test cleanup flakes (#1399) --- hack/install-kwok.sh | 2 +- test/pkg/environment/common/setup.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/hack/install-kwok.sh b/hack/install-kwok.sh index b4fad41243..ddc2c97b0e 100755 --- a/hack/install-kwok.sh +++ b/hack/install-kwok.sh @@ -112,8 +112,8 @@ crdURL="https://github.com/${KWOK_REPO}/releases/download/${KWOK_RELEASE}/stage- # Set UNINSTALL_KWOK=true if you want to uninstall. if [[ ${UNINSTALL_KWOK} = "true" ]] then - kubectl delete -f ${HOME_DIR}/kwok.yaml kubectl delete -f ${crdURL} + kubectl delete -f ${HOME_DIR}/kwok.yaml else kubectl apply -f ${HOME_DIR}/kwok.yaml kubectl apply -f ${crdURL} diff --git a/test/pkg/environment/common/setup.go b/test/pkg/environment/common/setup.go index aeaa5106b0..e99e9fee8e 100644 --- a/test/pkg/environment/common/setup.go +++ b/test/pkg/environment/common/setup.go @@ -135,7 +135,6 @@ func (env *Environment) CleanupObjects(cleanableObjects ...client.Object) { defer GinkgoRecover() g.Expect(env.ExpectTestingFinalizerRemoved(&metaList.Items[i])).To(Succeed()) g.Expect(client.IgnoreNotFound(env.Client.Delete(env, &metaList.Items[i], - client.PropagationPolicy(metav1.DeletePropagationForeground), &client.DeleteOptions{GracePeriodSeconds: lo.ToPtr(int64(0))}))).To(Succeed()) }) // If the deletes eventually succeed, we should have no elements here at the end of the test