Validate AgnhostPod readyness status in e2e tests

We now additionally check if the agnhost pods are ready before
marking the pod as running to increase the overall test stability.

Relates to: https://github.com/kubernetes/kubernetes/pull/82420
Fixes: https://github.com/kubernetes/kubernetes/issues/82445

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
This commit is contained in:
Sascha Grunert 2019-09-09 15:09:01 +02:00
parent 2d8b8703de
commit 5a8b695fef
No known key found for this signature in database
GPG Key ID: 8CE029DD1A866E52
3 changed files with 4 additions and 3 deletions

View File

@ -421,7 +421,7 @@ var _ = SIGDescribe("DNS", func() {
framework.Failf("ginkgo.Failed to delete pod %s: %v", testAgnhostPod.Name, err)
}
}()
err = f.WaitForPodRunning(testAgnhostPod.Name)
err = f.WaitForPodReady(testAgnhostPod.Name)
framework.ExpectNoError(err, "failed to wait for pod %s to be running", testAgnhostPod.Name)
runCommand := func(arg string) string {

View File

@ -145,7 +145,7 @@ var _ = SIGDescribe("Firewall rule", func() {
pod.Spec.HostNetwork = true
_, err := cs.CoreV1().Pods(ns).Create(pod)
framework.ExpectNoError(err)
framework.ExpectNoError(f.WaitForPodRunning(podName))
framework.ExpectNoError(f.WaitForPodReady(podName))
framework.Logf("Netexec pod %q in namespace %q running", podName, ns)
defer func() {

View File

@ -308,7 +308,7 @@ var _ = SIGDescribe("Services", func() {
pod.Labels = jig.Labels
_, err = cs.CoreV1().Pods(ns).Create(pod)
framework.ExpectNoError(err)
framework.ExpectNoError(f.WaitForPodRunning(pod.Name))
framework.ExpectNoError(f.WaitForPodReady(pod.Name))
defer func() {
framework.Logf("Cleaning up the echo server pod")
err := cs.CoreV1().Pods(ns).Delete(serverPodName, nil)
@ -366,6 +366,7 @@ var _ = SIGDescribe("Services", func() {
podTemplate.Labels = jig.Labels
pod, err := cs.CoreV1().Pods(ns).Create(podTemplate)
framework.ExpectNoError(err)
framework.ExpectNoError(f.WaitForPodReady(pod.Name))
ginkgo.By("waiting for the service to expose an endpoint")
err = e2eendpoints.ValidateEndpointsPorts(cs, ns, serviceName, e2eendpoints.PortsByPodName{serverPodName: {servicePort}})