Skip to content

Commit

Permalink
test/e2e/framework: fix closing of HTTP requests
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpasquier committed Mar 26, 2020
1 parent fcd53e5 commit f4f37b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/e2e/framework/route_client.go
Expand Up @@ -105,6 +105,7 @@ func (c *RouteClient) PrometheusQuery(query string) ([]byte, error) {
if err != nil {
return nil, err
}
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("unexpected status code response, want %d, got %d", http.StatusOK, resp.StatusCode)
Expand Down Expand Up @@ -145,13 +146,12 @@ func (c *RouteClient) AlertmanagerQuery(kvs ...string) ([]byte, error) {
if err != nil {
return nil, err
}
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("unexpected status code response, want %d, got %d", http.StatusOK, resp.StatusCode)
}

defer resp.Body.Close()

body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
Expand Down

0 comments on commit f4f37b3

Please sign in to comment.