Skip to content

Commit

Permalink
[chore] fix leak in test (open-telemetry#10197)
Browse files Browse the repository at this point in the history
This will allow enabling of goleak checks for the package.

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
  • Loading branch information
codeboten authored and andrzej-stencel committed May 27, 2024
1 parent d28c299 commit c37a36a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ func TestServiceTelemetryRestart(t *testing.T) {
// check telemetry server to ensure we get a response
var resp *http.Response

// #nosec G107
resp, err = http.Get(telemetryURL)
assert.NoError(t, err)
assert.NoError(t, resp.Body.Close())
assert.Equal(t, http.StatusOK, resp.StatusCode)

// Shutdown the service
Expand All @@ -338,8 +338,8 @@ func TestServiceTelemetryRestart(t *testing.T) {
// check telemetry server to ensure we get a response
require.Eventually(t,
func() bool {
// #nosec G107
resp, err = http.Get(telemetryURL)
assert.NoError(t, resp.Body.Close())
return err == nil
},
500*time.Millisecond,
Expand Down

0 comments on commit c37a36a

Please sign in to comment.