From c99b5a208deecad40bf1f2d13ebdbada28124d22 Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Tue, 14 Nov 2023 21:29:56 +0000 Subject: [PATCH] Check error from gomega Signed-off-by: James Sturtevant --- test/e2e/framework/autoscaling/autoscaling_utils.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/autoscaling/autoscaling_utils.go b/test/e2e/framework/autoscaling/autoscaling_utils.go index d7953a6d7ee..68f884b8272 100644 --- a/test/e2e/framework/autoscaling/autoscaling_utils.go +++ b/test/e2e/framework/autoscaling/autoscaling_utils.go @@ -507,16 +507,18 @@ func (rc *ResourceConsumer) WaitForReplicas(ctx context.Context, desiredReplicas // EnsureDesiredReplicasInRange ensure the replicas is in a desired range func (rc *ResourceConsumer) EnsureDesiredReplicasInRange(ctx context.Context, minDesiredReplicas, maxDesiredReplicas int, duration time.Duration, hpaName string) { interval := 10 * time.Second - framework.Gomega().Consistently(ctx, func(ctx context.Context) int { + desiredReplicasErr := framework.Gomega().Consistently(ctx, func(ctx context.Context) int { return rc.GetReplicas(ctx) }).WithTimeout(duration).WithPolling(interval).Should(gomega.And(gomega.BeNumerically(">=", minDesiredReplicas), gomega.BeNumerically("<=", maxDesiredReplicas))) + // dump HPA for debugging as, err := rc.GetHpa(ctx, hpaName) if err != nil { framework.Logf("Error getting HPA: %s", err) } else { framework.Logf("HPA status: %+v", as.Status) } + framework.ExpectNoError(desiredReplicasErr) } // Pause stops background goroutines responsible for consuming resources.