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

Ensure TaintBasedEviction int test not rely on TaintNodeByConditions #84036

Merged
merged 1 commit into from Oct 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
2 changes: 1 addition & 1 deletion test/integration/scheduler/taint_test.go
Expand Up @@ -689,7 +689,7 @@ func TestTaintBasedEvictions(t *testing.T) {
0.55, // Unhealthy zone threshold
true, // Run taint manager
true, // Use taint based evictions
false, // Enabled TaintNodeByCondition feature
true, // Enabled TaintNodeByCondition feature
)
if err != nil {
t.Errorf("Failed to create node controller: %v", err)
Expand Down
3 changes: 2 additions & 1 deletion test/integration/scheduler/util.go
Expand Up @@ -381,7 +381,8 @@ func nodeTainted(cs clientset.Interface, nodeName string, taints []v1.Taint) wai
return false, err
}

if len(taints) != len(node.Spec.Taints) {
Copy link
Member Author

Choose a reason for hiding this comment

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

In terms of the testcase, if both TaintBasedEviction and TaintNodeByCondtions are enabled, there should be at least 2 taints (NotReady:NoExecute and NotReady:NoSchedule) applied, so comparing the size is absolutely incorrect.

And also the comment said "contain", the old logic doesn't follow either.

// node.Spec.Taints may have more taints
if len(taints) > len(node.Spec.Taints) {
return false, nil
}

Expand Down