mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 07:03:31 +00:00
Stop using the deprecated Measure
method
As what suggested by Ginkgo migration guide, `Measure` node was deprecated and replaced with `It` node which creates `gmeasure.Experiment`. Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
@@ -30,11 +30,13 @@ import (
|
||||
admissionapi "k8s.io/pod-security-admission/api"
|
||||
|
||||
"github.com/onsi/ginkgo/v2"
|
||||
"github.com/onsi/gomega/gmeasure"
|
||||
)
|
||||
|
||||
var _ = SIGDescribe("[Feature:ClusterSizeAutoscalingScaleUp] [Slow] Autoscaling", func() {
|
||||
f := framework.NewDefaultFramework("autoscaling")
|
||||
f.NamespacePodSecurityEnforceLevel = admissionapi.LevelPrivileged
|
||||
var experiment *gmeasure.Experiment
|
||||
|
||||
ginkgo.Describe("Autoscaling a service", func() {
|
||||
ginkgo.BeforeEach(func() {
|
||||
@@ -43,6 +45,8 @@ var _ = SIGDescribe("[Feature:ClusterSizeAutoscalingScaleUp] [Slow] Autoscaling"
|
||||
if err != nil {
|
||||
e2eskipper.Skipf("test expects Cluster Autoscaler to be enabled")
|
||||
}
|
||||
experiment = gmeasure.NewExperiment("Autoscaling a service")
|
||||
ginkgo.AddReportEntry(experiment.Name, experiment)
|
||||
})
|
||||
|
||||
ginkgo.Context("from 1 pod and 3 nodes to 8 pods and >=4 nodes", func() {
|
||||
@@ -82,7 +86,7 @@ var _ = SIGDescribe("[Feature:ClusterSizeAutoscalingScaleUp] [Slow] Autoscaling"
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.Measure("takes less than 15 minutes", func(b ginkgo.Benchmarker) {
|
||||
ginkgo.It("takes less than 15 minutes", func() {
|
||||
// Measured over multiple samples, scaling takes 10 +/- 2 minutes, so 15 minutes should be fully sufficient.
|
||||
const timeToWait = 15 * time.Minute
|
||||
|
||||
@@ -111,10 +115,10 @@ var _ = SIGDescribe("[Feature:ClusterSizeAutoscalingScaleUp] [Slow] Autoscaling"
|
||||
resourceConsumer.ConsumeCPU(int(cpuLoad))
|
||||
|
||||
// Measure the time it takes for the service to scale to 8 pods with 50% CPU utilization each.
|
||||
b.Time("total scale-up time", func() {
|
||||
experiment.SampleDuration("total scale-up time", func(idx int) {
|
||||
resourceConsumer.WaitForReplicas(8, timeToWait)
|
||||
})
|
||||
}, 1) // Increase to run the test more than once.
|
||||
}, gmeasure.SamplingConfig{N: 1})
|
||||
}) // Increase to run the test more than once.
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user