From 95eaaeb883daa943ec56ebdc310eb20a3dd2830b Mon Sep 17 00:00:00 2001 From: Marcin Wielgus Date: Mon, 6 Jun 2016 10:37:11 +0200 Subject: [PATCH] Increase cluster size by 2 in scale down test to bypass Heapster nanny issue --- test/e2e/cluster_size_autoscaling.go | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/test/e2e/cluster_size_autoscaling.go b/test/e2e/cluster_size_autoscaling.go index d2b6f65257..2cce8f5751 100644 --- a/test/e2e/cluster_size_autoscaling.go +++ b/test/e2e/cluster_size_autoscaling.go @@ -137,14 +137,24 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() { }) It("should correctly handle pending and scale down after deletion [Feature:ClusterSizeAutoscalingScaleDown]", func() { - By("Small pending pods increase cluster size") - ReserveMemory(f, "memory-reservation", 100, nodeCount*memCapacityMb, false) - // Verify, that cluster size is increased + By("Manually increase cluster size") + increasedSize := 0 + newSizes := make(map[string]int) + for key, val := range originalSizes { + newSizes[key] = val + 2 + increasedSize += val + 2 + } + restoreSizes(newSizes) framework.ExpectNoError(WaitForClusterSizeFunc(f.Client, - func(size int) bool { return size >= nodeCount+1 }, scaleUpTimeout)) - framework.ExpectNoError(framework.DeleteRC(f.Client, f.Namespace.Name, "memory-reservation")) + func(size int) bool { return size >= increasedSize }, scaleUpTimeout)) + + By("Some node should be removed") framework.ExpectNoError(WaitForClusterSizeFunc(f.Client, - func(size int) bool { return size < nodeCount+1 }, scaleDownTimeout)) + func(size int) bool { return size < increasedSize }, scaleDownTimeout)) + + restoreSizes(originalSizes) + framework.ExpectNoError(WaitForClusterSizeFunc(f.Client, + func(size int) bool { return size <= nodeCount }, scaleDownTimeout)) }) It("should add node to the particular mig [Feature:ClusterSizeAutoscalingScaleUp]", func() {