Merge pull request #18249 from mvdan/apiserver-test-close

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot 2015-12-09 11:38:31 -08:00
commit e477503cf8

View File

@ -984,6 +984,7 @@ func TestList(t *testing.T) {
t.Errorf("%d: unexpected error: %v", i, err) t.Errorf("%d: unexpected error: %v", i, err)
continue continue
} }
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {
t.Errorf("%d: unexpected status: %d from url %s, Expected: %d, %#v", i, resp.StatusCode, testCase.url, http.StatusOK, resp) t.Errorf("%d: unexpected status: %d from url %s, Expected: %d, %#v", i, resp.StatusCode, testCase.url, http.StatusOK, resp)
body, err := ioutil.ReadAll(resp.Body) body, err := ioutil.ReadAll(resp.Body)