From b0265bed4282e2b4d2fb34ed49431362053932e9 Mon Sep 17 00:00:00 2001 From: Joachim Bartosik Date: Fri, 2 Nov 2018 11:24:23 +0100 Subject: [PATCH] Deflake e2e HPA tests Tests for scaling down based on external metric are flaky. I think this is because they: - Start with 2 replicas, - Export metric value == 1/2 target, - Expect scale down to 1. Since the expected recommendation is exactly 1 it might flake (and with scale down stabilization any recommendations higher than 1 will persist). Change expected value of the metric so recommended size will be lower than 1. This should make those tests less flaky. --- .../e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go b/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go index c562b056229..325c3bce439 100644 --- a/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go +++ b/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go @@ -86,7 +86,7 @@ var _ = SIGDescribe("[HPA] Horizontal pod autoscaling (scale resource: Custom Me initialReplicas := 2 // metric should cause scale down metricValue := externalMetricValue - metricTarget := 2 * metricValue + metricTarget := 3 * metricValue metricTargets := map[string]externalMetricTarget{ "target": { value: metricTarget, @@ -109,7 +109,7 @@ var _ = SIGDescribe("[HPA] Horizontal pod autoscaling (scale resource: Custom Me initialReplicas := 2 // metric should cause scale down metricValue := externalMetricValue - metricAverageTarget := (3 * metricValue) / 2 + metricAverageTarget := 3 * metricValue metricTargets := map[string]externalMetricTarget{ "target_average": { value: metricAverageTarget,