Skip to content

Commit

Permalink
fixed test failures
Browse files Browse the repository at this point in the history
Signed-off-by: Bharath Guvvala <bharath.raghavendra@gmail.com>
  • Loading branch information
bharathguvvala committed Jul 15, 2024
1 parent 50fc145 commit b500990
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/fallback/fallback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var _ = Describe("fallback", func() {
Expect(so.Status.Health[metricName]).To(haveFailureAndStatus(0, kedav1alpha1.HealthStatusHappy))
})

It("should reset the health status when scaler metrics are available when fallback is not enabled", func() {
It("should not reset the health status when fallback is not enabled", func() {
expectedMetricValue := float64(6)
startingNumberOfFailures := int32(5)
primeGetMetrics(scaler, expectedMetricValue)
Expand All @@ -134,7 +134,7 @@ var _ = Describe("fallback", func() {
Expect(err).ToNot(HaveOccurred())
value := metrics[0].Value.AsApproximateFloat64()
Expect(value).Should(Equal(expectedMetricValue))
Expect(so.Status.Health[metricName]).To(haveFailureAndStatus(0, kedav1alpha1.HealthStatusHappy))
Expect(so.Status.Health[metricName]).To(haveFailureAndStatus(5, kedav1alpha1.HealthStatusFailing))
})

It("should propagate the error when fallback is disabled", func() {
Expand Down Expand Up @@ -320,6 +320,7 @@ var _ = Describe("fallback", func() {
},
)
metricSpec := createMetricSpec(10)
expectStatusPatch(ctrl, client)

metrics, _, err := scaler.GetMetricsAndActivity(context.Background(), metricName)
_, _, err = GetMetricsWithFallback(context.Background(), client, metrics, err, metricName, so, metricSpec)
Expand Down

0 comments on commit b500990

Please sign in to comment.