From 2f278a316f488c1dae008a305412264ae74f0d50 Mon Sep 17 00:00:00 2001 From: Aleksandra Malinowska Date: Thu, 22 Nov 2018 21:25:03 +0100 Subject: [PATCH] Extend timeout before breaking node in autoscaling test --- test/e2e/autoscaling/cluster_size_autoscaling.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/e2e/autoscaling/cluster_size_autoscaling.go b/test/e2e/autoscaling/cluster_size_autoscaling.go index 60b09cb179c..2d2f866997d 100644 --- a/test/e2e/autoscaling/cluster_size_autoscaling.go +++ b/test/e2e/autoscaling/cluster_size_autoscaling.go @@ -881,6 +881,19 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() { clusterSize = manuallyIncreaseClusterSize(f, originalSizes) } + // If new nodes are disconnected too soon, they'll be considered not started + // instead of unready, and cluster won't be considered unhealthy. + // + // More precisely, Cluster Autoscaler compares last transition time of + // several readiness conditions to node create time. If it's within + // 2 minutes, it'll assume node is just starting and not unhealthy. + // + // Nodes become ready in less than 1 minute after being created, + // so waiting extra 2 minutes before breaking them (which triggers + // readiness condition transition) should be sufficient, while + // making no assumptions about minimal node startup time. + time.Sleep(2 * time.Minute) + By("Block network connectivity to some nodes to simulate unhealthy cluster") nodesToBreakCount := int(math.Ceil(math.Max(float64(unhealthyClusterThreshold), 0.5*float64(clusterSize)))) nodes, err := f.ClientSet.CoreV1().Nodes().List(metav1.ListOptions{FieldSelector: fields.Set{