From 1024ea75b37d58b01161bd526f5a4a8fb32361bf Mon Sep 17 00:00:00 2001 From: Nikolay Bondarenko Date: Fri, 25 Jan 2019 18:45:41 +0300 Subject: [PATCH] Add the deferred stop to prometheus wrapper test --- prometheus_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prometheus_test.go b/prometheus_test.go index 5c2948c..751bee3 100644 --- a/prometheus_test.go +++ b/prometheus_test.go @@ -44,6 +44,8 @@ func TestPrometheusMetrics(t *testing.T) { server.WrapHandler(NewHandlerWrapper()), ) + defer s.Stop() + type Test struct { *testHandler } @@ -85,8 +87,6 @@ func TestPrometheusMetrics(t *testing.T) { assert.Equal(t, *metric.Metric[1].Label[1].Name, "status") assert.Equal(t, *metric.Metric[1].Label[1].Value, "success") assert.Equal(t, *metric.Metric[1].Counter.Value, float64(1)) - - s.Stop() } func findMetricByName(list []*dto.MetricFamily, tp dto.MetricType, name string) *dto.MetricFamily {