Skip to content

Commit

Permalink
Adjust metrics test (#18837)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris S. Kim authored Sep 15, 2023
1 parent a89938e commit 461549e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions agent/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 461549e

Please sign in to comment.