Plugins: Require body is closed on test cleanup (#62668)

require body is closed on cleanup
pull/62700/head
Will Browne 2 years ago committed by GitHub
parent c139768e3b
commit 2f2046eff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      pkg/tests/api/plugins/api_plugins_test.go

@ -139,8 +139,7 @@ func makePostRequest(t *testing.T, URL string) (int, map[string]interface{}) {
resp, err := http.Post(URL, "application/json", bytes.NewBufferString(""))
require.NoError(t, err)
t.Cleanup(func() {
_ = resp.Body.Close()
fmt.Printf("Failed to close response body err: %s", err)
require.NoError(t, resp.Body.Close())
})
b, err := io.ReadAll(resp.Body)
require.NoError(t, err)

Loading…
Cancel
Save