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

Wait for pods to be running before eviction starts #80879

Merged
Merged
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
4 changes: 4 additions & 0 deletions test/e2e/scheduling/taints.go
Expand Up @@ -29,6 +29,7 @@ import (
"k8s.io/kubernetes/test/e2e/framework"
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
testutils "k8s.io/kubernetes/test/utils"
imageutils "k8s.io/kubernetes/test/utils/image"

Expand Down Expand Up @@ -426,6 +427,9 @@ var _ = SIGDescribe("NoExecuteTaintManager Multiple Pods [Serial]", func() {
pod2.Spec.NodeSelector = map[string]string{"kubernetes.io/hostname": nodeHostNameLabel}
_, err = testutils.RunPodAndGetNodeName(cs, pod2, 2*time.Minute)
framework.ExpectNoError(err)
// Wait for pods to be running state before eviction happens
framework.ExpectNoError(e2epod.WaitForPodRunningInNamespace(cs, pod1))
Copy link
Member

Choose a reason for hiding this comment

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

The name of RunPodAndGetNodeName function is mis-leading. I initially thought we already check that the pods are running, but looks like that function only waits until the pod is scheduled. We should probably rename that function in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, will change it in a another PR. Thanks :)

framework.ExpectNoError(e2epod.WaitForPodRunningInNamespace(cs, pod2))
e2elog.Logf("Pod2 is running on %v. Tainting Node", nodeName)

ginkgo.By("Trying to apply a taint on the Node")
Expand Down