Skip to content

Commit

Permalink
test: fix e2e tests assertion (#1395)
Browse files Browse the repository at this point in the history
  • Loading branch information
njtran authored Jul 5, 2024
1 parent 418ec52 commit 9c012d6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/suites/perf/scheduling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ var _ = Describe("Performance", func() {
It("should do complex provisioning", func() {
deployments := []*appsv1.Deployment{}
podOptions := test.MakeDiversePodOptions()
totalReplicas := 0
for _, option := range podOptions {
podDensity := replicas / len(podOptions)
totalReplicas += podDensity
deployments = append(deployments, test.Deployment(
test.DeploymentOptions{
PodOptions: option,
Replicas: int32(replicas / len(podOptions)),
Replicas: int32(podDensity),
},
))
}
Expand All @@ -106,17 +109,20 @@ var _ = Describe("Performance", func() {
}
env.TimeIntervalCollector.Start("PostDeployment")
env.ExpectCreated(nodePool, nodeClass)
env.EventuallyExpectHealthyPodCountWithTimeout(10*time.Minute, labelSelector, len(deployments)*replicas)
env.EventuallyExpectHealthyPodCountWithTimeout(10*time.Minute, labelSelector, totalReplicas)
env.TimeIntervalCollector.End("PostDeployment")
})
It("should do complex provisioning and complex drift", func() {
deployments := []*appsv1.Deployment{}
podOptions := test.MakeDiversePodOptions()
totalReplicas := 0
for _, option := range podOptions {
podDensity := replicas / len(podOptions)
totalReplicas += podDensity
deployments = append(deployments, test.Deployment(
test.DeploymentOptions{
PodOptions: option,
Replicas: int32(replicas / len(podOptions)),
Replicas: int32(podDensity),
},
))
}
Expand All @@ -125,7 +131,7 @@ var _ = Describe("Performance", func() {
}

env.ExpectCreated(nodePool, nodeClass)
env.EventuallyExpectHealthyPodCountWithTimeout(10*time.Minute, labelSelector, len(deployments)*replicas)
env.EventuallyExpectHealthyPodCountWithTimeout(10*time.Minute, labelSelector, totalReplicas)

env.TimeIntervalCollector.Start("Drift")
nodePool.Spec.Template.ObjectMeta.Labels = lo.Assign(nodePool.Spec.Template.ObjectMeta.Labels, map[string]string{
Expand Down

0 comments on commit 9c012d6

Please sign in to comment.