From 4574014b9b5ece63c4fc8b779735d15240f4aa63 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Fri, 31 Jan 2020 14:34:14 -0800 Subject: [PATCH 1/2] :bug: Integration test should close http body Signed-off-by: Vince Prignano --- pkg/internal/testing/integration/internal/process.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/internal/testing/integration/internal/process.go b/pkg/internal/testing/integration/internal/process.go index 7084b0d5e7..8ecf1afe5c 100644 --- a/pkg/internal/testing/integration/internal/process.go +++ b/pkg/internal/testing/integration/internal/process.go @@ -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 { From 6a437984b161bc5b131c17ecdc076a2d0d645448 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Fri, 31 Jan 2020 14:36:14 -0800 Subject: [PATCH 2/2] :running: Enable bodyclose linter Signed-off-by: Vince Prignano --- hack/verify.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/hack/verify.sh b/hack/verify.sh index 04ec12c799..9b25f7c487 100755 --- a/hack/verify.sh +++ b/hack/verify.sh @@ -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