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.
This commit is contained in:
Joachim Bartosik 2018-11-02 11:24:23 +01:00
parent 808557e468
commit b0265bed42

View File

@ -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,