From d5aea32d0792f8dced90d47a48277741315545c0 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Fri, 16 Oct 2015 12:22:11 +0200 Subject: [PATCH] Solve race between scheduler and kubelet about new node labels --- test/e2e/scheduler_predicates.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/e2e/scheduler_predicates.go b/test/e2e/scheduler_predicates.go index ce7b37c00b6..a2d06e36ed5 100644 --- a/test/e2e/scheduler_predicates.go +++ b/test/e2e/scheduler_predicates.go @@ -425,7 +425,13 @@ var _ = Describe("SchedulerPredicates", func() { }) expectNoError(err) defer c.Pods(ns).Delete(labelPodName, api.NewDeleteOptions(0)) - expectNoError(waitForPodRunningInNamespace(c, labelPodName, ns)) + + // check that pod got scheduled. We intentionally DO NOT check that the + // pod is running because this will create a race condition with the + // kubelet and the scheduler: the scheduler might have scheduled a pod + // already when the kubelet does not know about its new label yet. The + // kubelet will then refuse to launch the pod. + expectNoError(waitForPodNotPending(c, ns, labelPodName)) labelPod, err := c.Pods(ns).Get(labelPodName) expectNoError(err) Expect(labelPod.Spec.NodeName).To(Equal(nodeName))