Skip to content

Commit

Permalink
Fix tests after upgrade to prometheus v0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelSpeed committed Nov 1, 2018
1 parent b063917 commit 9bc6981
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/internal/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,9 @@ var _ = Describe("controller", func() {

var reconcileTime dto.Metric
Eventually(func() error {
ctrlmetrics.ReconcileTime.WithLabelValues(ctrl.Name).Write(&reconcileTime)
histObserver := ctrlmetrics.ReconcileTime.WithLabelValues(ctrl.Name)
hist := histObserver.(prometheus.Histogram)
hist.Write(&reconcileTime)
if reconcileTime.GetHistogram().GetSampleCount() != uint64(1) {
return fmt.Errorf("metrics not updated")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ var _ = Describe("manger.Manager", func() {
Name: "test_one",
Help: "test metric for testing",
})
one.Set(1)
one.Inc()
err := metrics.Registry.Register(one)
Expect(err).NotTo(HaveOccurred())

Expand Down

0 comments on commit 9bc6981

Please sign in to comment.