From 47ce53df056774c532d608b5b62ad8912624aad5 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Fri, 28 Apr 2017 15:46:48 +0200 Subject: [PATCH] e2e: deflake wait.Until in StatefulSet test Move watch GET calls nearer to the WATCH. --- test/e2e/statefulset.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/statefulset.go b/test/e2e/statefulset.go index 9f91bd77020..5008098910b 100644 --- a/test/e2e/statefulset.go +++ b/test/e2e/statefulset.go @@ -315,6 +315,9 @@ var _ = framework.KubeDescribe("StatefulSet", func() { expectedPodName := ss.Name + "-1" expectedPod, err := f.ClientSet.Core().Pods(ns).Get(expectedPodName, metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred()) + + By("Verifying the 2nd pod is removed only when it becomes running and ready") + sst.RestoreProbe(ss, testProbe) watcher, err := f.ClientSet.Core().Pods(ns).Watch(metav1.SingleObject( metav1.ObjectMeta{ Name: expectedPod.Name, @@ -322,9 +325,6 @@ var _ = framework.KubeDescribe("StatefulSet", func() { }, )) Expect(err).NotTo(HaveOccurred()) - - By("Verifying the 2nd pod is removed only when it becomes running and ready") - sst.RestoreProbe(ss, testProbe) _, err = watch.Until(framework.StatefulSetTimeout, watcher, func(event watch.Event) (bool, error) { pod := event.Object.(*v1.Pod) if event.Type == watch.Deleted && pod.Name == expectedPodName {