Skip to content

Commit

Permalink
fix: add response closures to web_test.go (prometheus#10675)
Browse files Browse the repository at this point in the history
* fix: add response closures to web_test.go

Signed-off-by: mtfoley <mtfoley.mae@gmail.com>
  • Loading branch information
mtfoley authored and roidelapluie committed Jun 22, 2022
1 parent 68a35f6 commit ae46157
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/web_test.go
Expand Up @@ -566,6 +566,9 @@ func TestAgentAPIEndPoints(t *testing.T) {
resp, err := http.DefaultClient.Do(req)
require.NoError(t, err)
require.Equal(t, http.StatusUnprocessableEntity, resp.StatusCode)
t.Cleanup(func() {
require.NoError(t, resp.Body.Close())
})
}
}

Expand All @@ -584,6 +587,9 @@ func TestAgentAPIEndPoints(t *testing.T) {
resp, err := http.DefaultClient.Do(req)
require.NoError(t, err)
require.Equal(t, http.StatusOK, resp.StatusCode)
t.Cleanup(func() {
require.NoError(t, resp.Body.Close())
})
}
}
}
Expand Down

0 comments on commit ae46157

Please sign in to comment.