From b87a8fd12a4616c91e098dd48270304dac82504f Mon Sep 17 00:00:00 2001 From: "Chris S. Kim" Date: Fri, 15 Sep 2023 19:01:02 -0400 Subject: [PATCH] Adjust metrics test --- agent/metrics_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/agent/metrics_test.go b/agent/metrics_test.go index 41013b3c7069..113699fa0ec3 100644 --- a/agent/metrics_test.go +++ b/agent/metrics_test.go @@ -35,9 +35,8 @@ func recordPromMetrics(t *testing.T, a *TestAgent, respRec *httptest.ResponseRec req, err := http.NewRequest("GET", "/v1/agent/metrics?format=prometheus", nil) require.NoError(t, err, "Failed to generate new http request.") - _, err = a.srv.AgentMetrics(respRec, req) - require.NoError(t, err, "Failed to serve agent metrics") - + a.srv.h.ServeHTTP(respRec, req) + require.Equalf(t, 200, respRec.Code, "expected 200, got %d, body: %s", respRec.Code, respRec.Body.String()) } func assertMetricExists(t *testing.T, respRec *httptest.ResponseRecorder, metric string) {