Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

promote e2e tests for taint-tolerations in predicates #83652

Merged
merged 1 commit into from Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions test/conformance/testdata/conformance.txt
Expand Up @@ -267,6 +267,7 @@ test/e2e/node/pre_stop.go: "should call prestop when killing a pod"
test/e2e/scheduling/predicates.go: "validates resource limits of pods that are allowed to run"
test/e2e/scheduling/predicates.go: "validates that NodeSelector is respected if not matching"
test/e2e/scheduling/predicates.go: "validates that NodeSelector is respected if matching"
test/e2e/scheduling/predicates.go: "validates that taints-tolerations is respected if matching"
test/e2e/scheduling/predicates.go: "validates that there is no conflict between pods with same hostPort but different hostIP and protocol"
test/e2e/scheduling/predicates.go: "validates that there exists conflict between pods with same hostPort and protocol but one using 0.0.0.0 hostIP"
test/e2e/scheduling/taints.go: "removing taint cancels eviction"
Expand Down
20 changes: 9 additions & 11 deletions test/e2e/scheduling/predicates.go
Expand Up @@ -453,11 +453,14 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
framework.ExpectEqual(labelPod.Spec.NodeName, nodeName)
})

// 1. Run a pod to get an available node, then delete the pod
// 2. Taint the node with a random taint
// 3. Try to relaunch the pod with tolerations tolerate the taints on node,
// and the pod's nodeName specified to the name of node found in step 1
ginkgo.It("validates that taints-tolerations is respected if matching", func() {
/*
Release : v1.18
Testname: Scheduler, taints-tolerations matching
Description: Find an available node and taint it with a key with effect NoSchedule. Schedule a pod with a
corresponding nodeLabel and toleration spec such that it should only be able to run on the selected node.
Ensure that the pod is scheduled and running on the node.
*/
Jefftree marked this conversation as resolved.
Show resolved Hide resolved
framework.ConformanceIt("validates that taints-tolerations is respected if matching [Disruptive]", func() {
nodeName := getNodeThatCanRunPodWithoutToleration(f)

ginkgo.By("Trying to apply a random taint on the found node.")
Expand Down Expand Up @@ -485,12 +488,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
NodeSelector: map[string]string{labelKey: labelValue},
})

// 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(e2epod.WaitForPodNotPending(cs, ns, tolerationPodName))
framework.ExpectNoError(e2epod.WaitForPodNameRunningInNamespace(cs, ns, tolerationPodName))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should have been split out into a separate PR prior to promoting to Conformance, so we could verify whether the test still passed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, sorry about that

deployedPod, err := cs.CoreV1().Pods(ns).Get(tolerationPodName, metav1.GetOptions{})
framework.ExpectNoError(err)
framework.ExpectEqual(deployedPod.Spec.NodeName, nodeName)
Expand Down