diff --git a/tests/scalers/dynatrace/dynatrace_test.go b/tests/scalers/dynatrace/dynatrace_test.go index 96f57d036da..7d20231a91a 100644 --- a/tests/scalers/dynatrace/dynatrace_test.go +++ b/tests/scalers/dynatrace/dynatrace_test.go @@ -201,6 +201,7 @@ func setMetricValue(t *testing.T, value float64, stopCh <-chan struct{}) { t.Log("Error executing request") continue } + defer r.Body.Close() if r.StatusCode != http.StatusAccepted { msg := fmt.Sprintf("%s: api returned %d", r.Request.URL.Path, r.StatusCode) t.Log(msg)