diff --git a/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go b/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go index 1732bd1b937..2f3b280ea53 100644 --- a/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go +++ b/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go @@ -264,10 +264,10 @@ func (tc *CustomMetricTestCase) Run() { defer monitoring.CleanupDescriptors(gcmService, projectID) err = monitoring.CreateAdapter(monitoring.AdapterDefault) + defer monitoring.CleanupAdapter(monitoring.AdapterDefault) if err != nil { framework.Failf("Failed to set up: %v", err) } - defer monitoring.CleanupAdapter(monitoring.AdapterDefault) // Run application that exports the metric err = createDeploymentToScale(tc.framework, tc.kubeClient, tc.deployment, tc.pod)