Merge pull request #79765 from clarklee92/use-ExpectEqual-autoscaling

use ExpectEqual under e2e/autoscaling
This commit is contained in:
Kubernetes Prow Robot 2019-07-08 05:06:34 -07:00 committed by GitHub
commit d771dfac3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -27,7 +27,6 @@ import (
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
)
var _ = SIGDescribe("[Feature:ClusterSizeAutoscalingScaleUp] [Slow] Autoscaling", func() {
@ -65,7 +64,7 @@ var _ = SIGDescribe("[Feature:ClusterSizeAutoscalingScaleUp] [Slow] Autoscaling"
// Make sure all nodes are schedulable, otherwise we are in some kind of a problem state.
nodes = framework.GetReadySchedulableNodesOrDie(f.ClientSet)
schedulableCount := len(nodes.Items)
gomega.Expect(schedulableCount).To(gomega.Equal(nodeGroupSize), "not all nodes are schedulable")
framework.ExpectEqual(schedulableCount, nodeGroupSize, "not all nodes are schedulable")
})
ginkgo.AfterEach(func() {

View File

@ -349,7 +349,8 @@ var _ = framework.KubeDescribe("Cluster size autoscaler scalability [Slow]", fun
defer framework.DeleteRCAndWaitForGC(f.ClientSet, f.Namespace.Name, podsConfig.Name)
// Ensure that no new nodes have been added so far.
gomega.Expect(e2enode.TotalReady(f.ClientSet)).To(gomega.Equal(nodeCount))
readyNodeCount, _ := e2enode.TotalReady(f.ClientSet)
framework.ExpectEqual(readyNodeCount, nodeCount)
// Start a number of schedulable pods to ensure CA reacts.
additionalNodes := maxNodes - nodeCount

View File

@ -818,7 +818,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
defer disableAutoscaler(extraPoolName, 0, 1)
ngNodes := getPoolNodes(f, extraPoolName)
gomega.Expect(len(ngNodes)).To(gomega.Equal(extraNodes))
framework.ExpectEqual(len(ngNodes), extraNodes)
for _, node := range ngNodes {
ginkgo.By(fmt.Sprintf("Target node for scale-down: %s", node.Name))
}
@ -1921,7 +1921,7 @@ func createPriorityClasses(f *framework.Framework) func() {
if err != nil {
klog.Errorf("Error creating priority class: %v", err)
}
gomega.Expect(err == nil || errors.IsAlreadyExists(err)).To(gomega.Equal(true))
framework.ExpectEqual(err == nil || errors.IsAlreadyExists(err), true)
}
return func() {