e2e storage: wait for pod deletion

After deleting a pod, we need to be sure that it really is gone,
otherwise there is a race condition: if we remove the CSI driver that
is responsible for the volume used by the pod before the pod is
actually deleted, deleting the pod will fail.
This commit is contained in:
Patrick Ohly 2019-07-30 20:11:48 +02:00
parent 7d2ad805a9
commit cead39cc97

View File

@ -588,7 +588,8 @@ func StartInPodWithVolume(c clientset.Interface, ns, claimName, podName, command
return pod
}
// StopPod first tries to log the output of the pod's container, then deletes the pod.
// StopPod first tries to log the output of the pod's container, then deletes the pod and
// waits for that to succeed.
func StopPod(c clientset.Interface, pod *v1.Pod) {
if pod == nil {
return
@ -600,6 +601,7 @@ func StopPod(c clientset.Interface, pod *v1.Pod) {
e2elog.Logf("Pod %s has the following logs: %s", pod.Name, body)
}
e2epod.DeletePodOrFail(c, pod.Namespace, pod.Name)
e2epod.WaitForPodNoLongerRunningInNamespace(c, pod.Name, pod.Namespace)
}
func verifyPVCsPending(client clientset.Interface, pvcs []*v1.PersistentVolumeClaim) {