Close this HTTP response body in TestE2EFullIntegration.

Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
Matt Moyer 2021-03-05 08:45:25 -06:00
parent c3b7d21037
commit d848499176
No known key found for this signature in database
GPG Key ID: EAE88AD172C5AE2D

View File

@ -297,12 +297,13 @@ func TestE2EFullIntegration(t *testing.T) {
} }
req, err := http.NewRequestWithContext(ctx, http.MethodGet, restConfig.Host, nil) req, err := http.NewRequestWithContext(ctx, http.MethodGet, restConfig.Host, nil)
require.NoError(t, err) require.NoError(t, err)
resp, err := httpClient.Do(req) //nolint:bodyclose resp, err := httpClient.Do(req)
if err != nil { if err != nil {
t.Logf("could not connect to the API server at %q: %v", restConfig.Host, err) t.Logf("could not connect to the API server at %q: %v", restConfig.Host, err)
return false return false
} }
t.Logf("got %d response from API server at %q", resp.StatusCode, restConfig.Host) t.Logf("got %d response from API server at %q", resp.StatusCode, restConfig.Host)
require.NoError(t, resp.Body.Close())
return resp.StatusCode < 500 return resp.StatusCode < 500
}, 5*time.Minute, 2*time.Second) }, 5*time.Minute, 2*time.Second)