mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #79765 from clarklee92/use-ExpectEqual-autoscaling
use ExpectEqual under e2e/autoscaling
This commit is contained in:
commit
d771dfac3d
@ -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() {
|
||||
|
@ -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
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user