Merge pull request #26517 from wojtek-t/large_cluster_tests

Automatic merge from submit-queue

Some fixes to tests to support large clusters
This commit is contained in:
k8s-merge-robot 2016-05-30 09:54:18 -07:00
commit 5a09908975
2 changed files with 14 additions and 2 deletions

View File

@ -2598,7 +2598,10 @@ func GetReadySchedulableNodesOrDie(c *client.Client) (nodes *api.NodeList) {
// previous tests may have cause failures of some nodes. Let's skip
// 'Not Ready' nodes, just in case (there is no need to fail the test).
FilterNodes(nodes, func(node api.Node) bool {
return !node.Spec.Unschedulable && IsNodeConditionSetAsExpected(&node, api.NodeReady, true)
nodeReady := IsNodeConditionSetAsExpected(&node, api.NodeReady, true)
networkReady := IsNodeConditionUnset(&node, api.NodeNetworkUnavailable) ||
IsNodeConditionSetAsExpected(&node, api.NodeNetworkUnavailable, false)
return !node.Spec.Unschedulable && nodeReady && networkReady
})
return nodes
}
@ -3389,6 +3392,15 @@ func IsNodeConditionSetAsExpected(node *api.Node, conditionType api.NodeConditio
return false
}
func IsNodeConditionUnset(node *api.Node, conditionType api.NodeConditionType) bool {
for _, cond := range node.Status.Conditions {
if cond.Type == conditionType {
return false
}
}
return true
}
// WaitForNodeToBe returns whether node "name's" condition state matches wantTrue
// within timeout. If wantTrue is true, it will ensure the node condition status
// is ConditionTrue; if it's false, it ensures the node condition is in any state

View File

@ -35,7 +35,7 @@ const (
// These tests don't seem to be running properly in parallel: issue: #20338.
//
var _ = framework.KubeDescribe("Horizontal pod autoscaling (scale resource: CPU)", func() {
var _ = framework.KubeDescribe("[HPA] Horizontal pod autoscaling (scale resource: CPU)", func() {
var rc *ResourceConsumer
f := framework.NewDefaultFramework("horizontal-pod-autoscaling")