diff options
| author | gy95 <guoyao17@huawei.com> | 2021-10-14 15:03:40 +0800 |
|---|---|---|
| committer | gy95 <guoyao17@huawei.com> | 2021-10-14 15:03:40 +0800 |
| commit | 0dda1eead9dbda8969ec8376384e44c8dc792524 (patch) | |
| tree | 70e2c8a1a6b00feb13db66248dac53f17ac29d23 /tests/e2e/utils | |
| parent | Merge pull request #3226 from gy95/verify-crd (diff) | |
| download | kubeedge-0dda1eead9dbda8969ec8376384e44c8dc792524.tar.gz | |
fix resp body close
Signed-off-by: gy95 <guoyao17@huawei.com>
Diffstat (limited to 'tests/e2e/utils')
| -rw-r--r-- | tests/e2e/utils/rule.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/e2e/utils/rule.go b/tests/e2e/utils/rule.go index 0478b2b4b..812441e66 100644 --- a/tests/e2e/utils/rule.go +++ b/tests/e2e/utils/rule.go @@ -246,6 +246,7 @@ func HandleRule(operation, apiserver, UID string, sourceType, targetType rulesv1 Fatalf("HTTP request is failed :%v", err) return false, 0 } + defer resp.Body.Close() contents, err := ioutil.ReadAll(resp.Body) Infof("%s %s %v %v in %v", req.Method, req.URL, resp.Status, string(contents), time.Since(t)) return true, resp.StatusCode @@ -289,6 +290,7 @@ func HandleRuleEndpoint(operation string, apiserver string, UID string, endpoint Fatalf("HTTP request is failed :%v", err) return false, 0 } + defer resp.Body.Close() Infof("%s %s %v in %v", req.Method, req.URL, resp.Status, time.Since(t)) return true, resp.StatusCode } |
