From c8e546926ab6874c997d6e064c25157638b595b4 Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Fri, 27 Jan 2017 15:20:36 -0500 Subject: [PATCH] Fix two staticcheck issues in IPVS collector tests --- collector/ipvs_linux_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/collector/ipvs_linux_test.go b/collector/ipvs_linux_test.go index 1a3cf3f1..740b90de 100644 --- a/collector/ipvs_linux_test.go +++ b/collector/ipvs_linux_test.go @@ -15,6 +15,7 @@ package collector import ( "flag" + "fmt" "io/ioutil" "net" "net/http" @@ -23,6 +24,7 @@ import ( "testing" "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/procfs" ) @@ -130,7 +132,7 @@ func TestIPVSCollector(t *testing.T) { go func() { err = collector.Update(sink) if err != nil { - t.Fatal(err) + panic(fmt.Sprintf("failed to update collector: %v", err)) } }() for expected, got := range map[string]string{ @@ -178,7 +180,7 @@ func TestIPVSCollectorResponse(t *testing.T) { prometheus.MustRegister(miniCollector{c: collector}) rw := httptest.NewRecorder() - prometheus.Handler().ServeHTTP(rw, &http.Request{}) + promhttp.Handler().ServeHTTP(rw, &http.Request{}) metricsFile := "fixtures/ip_vs_result.txt" wantMetrics, err := ioutil.ReadFile(metricsFile)