Skip to content

Commit 29fb7a5

Browse files
committed
Fix tests after upgrade to prometheus v0.9.0
1 parent 3c9b255 commit 29fb7a5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/internal/controller/controller_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,9 @@ var _ = Describe("controller", func() {
479479

480480
var reconcileTime dto.Metric
481481
Eventually(func() error {
482-
ctrlmetrics.ReconcileTime.WithLabelValues(ctrl.Name).Write(&reconcileTime)
482+
histObserver := ctrlmetrics.ReconcileTime.WithLabelValues(ctrl.Name)
483+
hist := histObserver.(prometheus.Histogram)
484+
hist.Write(&reconcileTime)
483485
if reconcileTime.GetHistogram().GetSampleCount() != uint64(1) {
484486
return fmt.Errorf("metrics not updated")
485487
}

pkg/manager/manager_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ var _ = Describe("manger.Manager", func() {
360360
Name: "test_one",
361361
Help: "test metric for testing",
362362
})
363-
one.Set(1)
363+
one.Inc()
364364
err := metrics.Registry.Register(one)
365365
Expect(err).NotTo(HaveOccurred())
366366

0 commit comments

Comments
 (0)