Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/prestoalvarez_patch3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix resource leak in prometheus service test by properly closing HTTP response body.
2 changes: 2 additions & 0 deletions monitoring/prometheus/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func TestLifecycle(t *testing.T) {
// Query the service to ensure it really started.
resp, err := http.Get(fmt.Sprintf("http://localhost:%d/metrics", port))
require.NoError(t, err)
// Close response body to avoid leaking connections.
defer resp.Body.Close()
assert.NotEqual(t, uint64(0), resp.ContentLength, "Unexpected content length 0")

err = prometheusService.Stop()
Expand Down