Merge pull request #29003 from gmarek/taint

Fix the fix for taint scheduler predicate test
This commit is contained in:
Marek Grabowski 2016-07-15 16:15:02 +02:00 committed by GitHub
commit d1ff1b9726

View File

@ -1544,19 +1544,20 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
verifyResult(c, podNameNoTolerations, ns)
cleanupPods(c, ns)
By("Trying to relaunch the same.")
_, err = c.Pods(ns).Create(&podNoTolerations)
framework.ExpectNoError(err)
defer c.Pods(ns).Delete(podNameNoTolerations, api.NewDeleteOptions(0))
// TODO(@kevin-wangzefeng) Figure out how to do it correctly
// By("Trying to relaunch the same.")
// _, err = c.Pods(ns).Create(&podNoTolerations)
// framework.ExpectNoError(err)
// defer c.Pods(ns).Delete(podNameNoTolerations, api.NewDeleteOptions(0))
// 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 taint yet. The
// kubelet will then refuse to launch the pod.
framework.ExpectNoError(framework.WaitForPodNotPending(c, ns, podNameNoTolerations))
deployedPod, err := c.Pods(ns).Get(podNameNoTolerations)
framework.ExpectNoError(err)
Expect(deployedPod.Spec.NodeName).To(Equal(nodeName))
// // 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 taint yet. The
// // kubelet will then refuse to launch the pod.
// framework.ExpectNoError(framework.WaitForPodNotPending(c, ns, podNameNoTolerations))
// deployedPod, err := c.Pods(ns).Get(podNameNoTolerations)
// framework.ExpectNoError(err)
// Expect(deployedPod.Spec.NodeName).To(Equal(nodeName))
})
})