diff --git a/test/e2e/scheduling/equivalence_cache_predicates.go b/test/e2e/scheduling/equivalence_cache_predicates.go index 9eb0d8a44a8..94789da2a09 100644 --- a/test/e2e/scheduling/equivalence_cache_predicates.go +++ b/test/e2e/scheduling/equivalence_cache_predicates.go @@ -91,7 +91,7 @@ var _ = framework.KubeDescribe("EquivalenceCache [Serial]", func() { WaitForSchedulerAfterAction(f, func() error { err := CreateNodeSelectorPods(f, rcName, 2, nodeSelector, false) return err - }, rcName, false) + }, ns, rcName, false) defer framework.DeleteRCAndPods(f.ClientSet, f.InternalClientset, f.ScalesGetter, ns, rcName) // the first replica pod is scheduled, and the second pod will be rejected. verifyResult(cs, 1, 1, ns) @@ -157,7 +157,7 @@ var _ = framework.KubeDescribe("EquivalenceCache [Serial]", func() { WaitForSchedulerAfterAction(f, func() error { err := framework.ScaleRC(f.ClientSet, f.InternalClientset, f.ScalesGetter, ns, affinityRCName, uint(replica+1), false) return err - }, affinityRCName, false) + }, ns, affinityRCName, false) // and this new pod should be rejected since node label has been updated verifyReplicasResult(cs, replica, 1, ns, affinityRCName) }) @@ -222,7 +222,7 @@ var _ = framework.KubeDescribe("EquivalenceCache [Serial]", func() { WaitForSchedulerAfterAction(f, func() error { _, err := cs.CoreV1().ReplicationControllers(ns).Create(rc) return err - }, labelRCName, false) + }, ns, labelRCName, false) // these two replicas should all be rejected since podAntiAffinity says it they anit-affinity with pod {"service": "S1"} verifyReplicasResult(cs, 0, replica, ns, labelRCName) diff --git a/test/e2e/scheduling/events.go b/test/e2e/scheduling/events.go index 1f25474de3e..df55b40588f 100644 --- a/test/e2e/scheduling/events.go +++ b/test/e2e/scheduling/events.go @@ -23,12 +23,12 @@ import ( "k8s.io/api/core/v1" ) -func scheduleSuccessEvent(podName, nodeName string) func(*v1.Event) bool { +func scheduleSuccessEvent(ns, podName, nodeName string) func(*v1.Event) bool { return func(e *v1.Event) bool { return e.Type == v1.EventTypeNormal && e.Reason == "Scheduled" && strings.HasPrefix(e.Name, podName) && - strings.Contains(e.Message, fmt.Sprintf("Successfully assigned %v to %v", podName, nodeName)) + strings.Contains(e.Message, fmt.Sprintf("Successfully assigned %v/%v to %v", ns, podName, nodeName)) } } diff --git a/test/e2e/scheduling/predicates.go b/test/e2e/scheduling/predicates.go index 731b30228ee..d135221ec76 100644 --- a/test/e2e/scheduling/predicates.go +++ b/test/e2e/scheduling/predicates.go @@ -147,7 +147,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() { WaitForSchedulerAfterAction(f, createPausePodAction(f, pausePodConfig{ Name: podName, Labels: map[string]string{"name": "additional"}, - }), podName, false) + }), ns, podName, false) verifyResult(cs, podsNeededForSaturation, 1, ns) }) @@ -222,7 +222,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() { }, }, } - WaitForSchedulerAfterAction(f, createPausePodAction(f, conf), podName, false) + WaitForSchedulerAfterAction(f, createPausePodAction(f, conf), ns, podName, false) verifyResult(cs, podsNeededForSaturation, 1, ns) }) @@ -337,7 +337,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() { }, }, } - WaitForSchedulerAfterAction(f, createPausePodAction(f, conf), podName, false) + WaitForSchedulerAfterAction(f, createPausePodAction(f, conf), ns, podName, false) verifyResult(cs, len(fillerPods), 1, ns) }) @@ -362,7 +362,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() { }, } - WaitForSchedulerAfterAction(f, createPausePodAction(f, conf), podName, false) + WaitForSchedulerAfterAction(f, createPausePodAction(f, conf), ns, podName, false) verifyResult(cs, 0, 1, ns) }) @@ -461,7 +461,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() { }, Labels: map[string]string{"name": "restricted"}, } - WaitForSchedulerAfterAction(f, createPausePodAction(f, conf), podName, false) + WaitForSchedulerAfterAction(f, createPausePodAction(f, conf), ns, podName, false) verifyResult(cs, 0, 1, ns) }) @@ -585,11 +585,11 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() { NodeSelector: map[string]string{labelKey: labelValue}, } - WaitForSchedulerAfterAction(f, createPausePodAction(f, conf), podNameNoTolerations, false) + WaitForSchedulerAfterAction(f, createPausePodAction(f, conf), ns, podNameNoTolerations, false) verifyResult(cs, 0, 1, ns) By("Removing taint off the node") - WaitForSchedulerAfterAction(f, removeTaintFromNodeAction(cs, nodeName, testTaint), podNameNoTolerations, true) + WaitForSchedulerAfterAction(f, removeTaintFromNodeAction(cs, nodeName, testTaint), ns, podNameNoTolerations, true) verifyResult(cs, 1, 0, ns) }) @@ -736,10 +736,10 @@ func createPausePodAction(f *framework.Framework, conf pausePodConfig) common.Ac // WaitForSchedulerAfterAction performs the provided action and then waits for // scheduler to act on the given pod. -func WaitForSchedulerAfterAction(f *framework.Framework, action common.Action, podName string, expectSuccess bool) { +func WaitForSchedulerAfterAction(f *framework.Framework, action common.Action, ns, podName string, expectSuccess bool) { predicate := scheduleFailureEvent(podName) if expectSuccess { - predicate = scheduleSuccessEvent(podName, "" /* any node */) + predicate = scheduleSuccessEvent(ns, podName, "" /* any node */) } success, err := common.ObserveEventAfterAction(f, predicate, action) Expect(err).NotTo(HaveOccurred())