Skip to content

Commit

Permalink
Merge pull request #786 from vincepri/fix-body-leak
Browse files Browse the repository at this point in the history
🐛 Integration test should close http body
  • Loading branch information
k8s-ci-robot authored Feb 10, 2020
2 parents 82a78f9 + 6a43798 commit 702a4a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions hack/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ golangci-lint run --disable-all \
--enable=lll \
--enable=dupl \
--enable=goimports \
--enable=bodyclose \
./pkg/... ./examples/... .

# TODO: Enable these as we fix them to make them pass
Expand Down
9 changes: 6 additions & 3 deletions pkg/internal/testing/integration/internal/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,12 @@ func pollURLUntilOK(url url.URL, interval time.Duration, ready chan bool, stopCh
}
for {
res, err := http.Get(url.String())
if err == nil && res.StatusCode == http.StatusOK {
ready <- true
return
if err == nil {
res.Body.Close()
if res.StatusCode == http.StatusOK {
ready <- true
return
}
}

select {
Expand Down

0 comments on commit 702a4a4

Please sign in to comment.