From 9826837dce6c841d41889e1c59cacea39eb6ce78 Mon Sep 17 00:00:00 2001 From: Dimitri Koshkin Date: Thu, 7 Feb 2019 18:30:49 -0500 Subject: [PATCH] Fix race condition in DynamicallyProvisionedDeletePodTest Waif for pod to be actually deleted before checking if the replacement pod is running --- tests/e2e/testsuites/testsuites.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/e2e/testsuites/testsuites.go b/tests/e2e/testsuites/testsuites.go index 4236323dc3..6685f6d068 100644 --- a/tests/e2e/testsuites/testsuites.go +++ b/tests/e2e/testsuites/testsuites.go @@ -344,6 +344,13 @@ func (t *TestDeployment) DeletePodAndWait() { } return } + framework.Logf("Waiting for pod %q in namespace %q to be fully deleted", t.podName, t.namespace.Name) + err = framework.WaitForPodNoLongerRunningInNamespace(t.client, t.podName, t.namespace.Name) + if err != nil { + if !apierrs.IsNotFound(err) { + framework.ExpectNoError(fmt.Errorf("pod %q error waiting for delete: %v", t.podName, err)) + } + } } func (t *TestDeployment) Cleanup() {