diff --git a/test/e2e/autoscaling/autoscaling_timer.go b/test/e2e/autoscaling/autoscaling_timer.go index 91e0e4a8e31..f6c47d62dd2 100644 --- a/test/e2e/autoscaling/autoscaling_timer.go +++ b/test/e2e/autoscaling/autoscaling_timer.go @@ -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() { diff --git a/test/e2e/autoscaling/cluster_autoscaler_scalability.go b/test/e2e/autoscaling/cluster_autoscaler_scalability.go index a8f4c46f5d2..16612dd87db 100644 --- a/test/e2e/autoscaling/cluster_autoscaler_scalability.go +++ b/test/e2e/autoscaling/cluster_autoscaler_scalability.go @@ -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 diff --git a/test/e2e/autoscaling/cluster_size_autoscaling.go b/test/e2e/autoscaling/cluster_size_autoscaling.go index 32a858f58e7..b3468846b97 100644 --- a/test/e2e/autoscaling/cluster_size_autoscaling.go +++ b/test/e2e/autoscaling/cluster_size_autoscaling.go @@ -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() {