Skip to content

Commit 25c91e5

Browse files
committed
(e2e) Reduce Consistently time for catalogsource_ready metrics check
This test was checking for the catalogsource_ready metrics being emitted with a particular value, consistently for a period of time. `Consistently` blocks for the duration of time mentioned (previously 3m). Unfortunately, there is no way to write an `Eventually` that starts polling after an interval, which could have been the non-blocking alternatve to using Consistently to perform the same check. This PR reduces the period of time the test is blocked Consistently to 1m, to reduce the test package's overall runtime. Ref: https://onsi.github.io/gomega/#eventually https://onsi.github.io/gomega/#consistently Signed-off-by: Anik Bhattacharjee <[email protected]>
1 parent f8d7f78 commit 25c91e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: test/e2e/metrics_e2e_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ var _ = Describe("Metrics are generated for OLM managed resources", func() {
368368
AfterEach(func() {
369369
cleanup()
370370
})
371-
It("emits metrics for the catalogSource", func() {
371+
It("emits catalogsource_ready metric for the catalogSource with Value equal to 1", func() {
372372
Eventually(func() []Metric {
373373
return getMetricsFromPod(c, getPodWithLabel(c, "app=catalog-operator"))
374374
}).Should(And(
@@ -412,7 +412,7 @@ var _ = Describe("Metrics are generated for OLM managed resources", func() {
412412
AfterEach(func() {
413413
cleanup()
414414
})
415-
It("emits metrics for the CatlogSource with a Value greater than 0", func() {
415+
It("emits metrics for the CatlogSource with a Value equal to 0", func() {
416416
Eventually(func() []Metric {
417417
return getMetricsFromPod(c, getPodWithLabel(c, "app=catalog-operator"))
418418
}).Should(And(
@@ -425,7 +425,7 @@ var _ = Describe("Metrics are generated for OLM managed resources", func() {
425425
))
426426
Consistently(func() []Metric {
427427
return getMetricsFromPod(c, getPodWithLabel(c, "app=catalog-operator"))
428-
}, "3m").Should(And(
428+
}, "1m", "30s").Should(And(
429429
ContainElement(LikeMetric(
430430
WithFamily("catalogsource_ready"),
431431
WithName(name),

0 commit comments

Comments
 (0)