diff --git a/api/test/e2enew/upstream/upstream_chash_query_string_arg_xxx_test.go b/api/test/e2enew/upstream/upstream_chash_query_string_arg_xxx_test.go index 18f36208d1..8bd8a3d00e 100644 --- a/api/test/e2enew/upstream/upstream_chash_query_string_arg_xxx_test.go +++ b/api/test/e2enew/upstream/upstream_chash_query_string_arg_xxx_test.go @@ -92,14 +92,15 @@ var _ = ginkgo.Describe("Upstream chash query string", func() { assert.Nil(t, err) resp, err := http.DefaultClient.Do(req) assert.Nil(t, err) + defer resp.Body.Close() respBody, err := ioutil.ReadAll(resp.Body) + assert.Nil(t, err) body := string(respBody) if _, ok := res[body]; !ok { res[body] = 1 } else { res[body]++ } - resp.Body.Close() } var counts []int for _, value := range res { @@ -179,14 +180,15 @@ var _ = ginkgo.Describe("Upstream chash query string", func() { assert.Nil(t, err) resp, err := http.DefaultClient.Do(req) assert.Nil(t, err) + defer resp.Body.Close() respBody, err := ioutil.ReadAll(resp.Body) + assert.Nil(t, err) body := string(respBody) if _, ok := res[body]; !ok { res[body] = 1 } else { res[body]++ } - resp.Body.Close() } var counts []int for _, value := range res {