@@ -454,14 +454,11 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
454
454
framework .ExpectEqual (labelPod .Spec .NodeName , nodeName )
455
455
})
456
456
457
- /*
458
- Release : v1.18
459
- Testname: Scheduler, taints-tolerations matching
460
- Description: Find an available node and taint it with a key with effect NoSchedule. Schedule a pod with a
461
- corresponding nodeLabel and toleration spec such that it should only be able to run on the selected node.
462
- Ensure that the pod is scheduled and running on the node.
463
- */
464
- framework .ConformanceIt ("validates that taints-tolerations is respected if matching [Disruptive]" , func () {
457
+ // 1. Run a pod to get an available node, then delete the pod
458
+ // 2. Taint the node with a random taint
459
+ // 3. Try to relaunch the pod with tolerations tolerate the taints on node,
460
+ // and the pod's nodeName specified to the name of node found in step 1
461
+ ginkgo .It ("validates that taints-tolerations is respected if matching" , func () {
465
462
nodeName := getNodeThatCanRunPodWithoutToleration (f )
466
463
467
464
ginkgo .By ("Trying to apply a random taint on the found node." )
@@ -489,7 +486,12 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
489
486
NodeSelector : map [string ]string {labelKey : labelValue },
490
487
})
491
488
492
- framework .ExpectNoError (e2epod .WaitForPodNameRunningInNamespace (cs , ns , tolerationPodName ))
489
+ // check that pod got scheduled. We intentionally DO NOT check that the
490
+ // pod is running because this will create a race condition with the
491
+ // kubelet and the scheduler: the scheduler might have scheduled a pod
492
+ // already when the kubelet does not know about its new taint yet. The
493
+ // kubelet will then refuse to launch the pod.
494
+ framework .ExpectNoError (e2epod .WaitForPodNotPending (cs , ns , tolerationPodName ))
493
495
deployedPod , err := cs .CoreV1 ().Pods (ns ).Get (tolerationPodName , metav1.GetOptions {})
494
496
framework .ExpectNoError (err )
495
497
framework .ExpectEqual (deployedPod .Spec .NodeName , nodeName )
0 commit comments