From 03fd3b6189848ef823cb31bde223c39f5046fae0 Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Wed, 8 Jun 2016 20:48:32 -0700 Subject: [PATCH] e2e: actually check error when we fail to GET the scheduled pod and GET the pod before we try to gracefully delete it. --- test/e2e/pods.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/e2e/pods.go b/test/e2e/pods.go index 8bd1f9920e7..7fb8249446e 100644 --- a/test/e2e/pods.go +++ b/test/e2e/pods.go @@ -346,6 +346,11 @@ var _ = framework.KubeDescribe("Pods", func() { // We need to wait for the pod to be scheduled, otherwise the deletion // will be carried out immediately rather than gracefully. framework.ExpectNoError(f.WaitForPodRunning(pod.Name)) + // save the scheduled pod + if pod, err = podClient.Get(pod.Name); err != nil { + Expect(err).NotTo(HaveOccurred(), "failed to GET scheduled pod") + } + framework.Logf("scheduled pod: %#v", pod) By("deleting the pod gracefully") if err := podClient.Delete(pod.Name, api.NewDeleteOptions(30)); err != nil { @@ -353,7 +358,6 @@ var _ = framework.KubeDescribe("Pods", func() { } By("verifying the kubelet observed the termination notice") - pod, err = podClient.Get(pod.Name) Expect(wait.Poll(time.Second*5, time.Second*30, func() (bool, error) { podList, err := framework.GetKubeletPods(f.Client, pod.Spec.NodeName) if err != nil {