Commit 887aeaa1 authored by Filip Grzadkowski's avatar Filip Grzadkowski

Merge pull request #15214 from piosz/e2e-fix

Fixed flaky cluster size autoscaling e2e.
parents c1345ce2 a8bd2354
......@@ -29,6 +29,11 @@ import (
. "github.com/onsi/gomega"
)
const (
scaleUpTimeout = 20 * time.Minute
scaleDownTimeout = 30 * time.Minute
)
var _ = Describe("Autoscaling", func() {
f := NewFramework("autoscaling")
var nodeCount int
......@@ -58,20 +63,20 @@ var _ = Describe("Autoscaling", func() {
// Consume 50% CPU
millicoresPerReplica := 500
rc := NewStaticResourceConsumer("cpu-utilization", nodeCount*coresPerNode, millicoresPerReplica*nodeCount*coresPerNode, 0, int64(millicoresPerReplica), 100, f)
expectNoError(waitForClusterSize(f.Client, nodeCount+1, 20*time.Minute))
expectNoError(waitForClusterSize(f.Client, nodeCount+1, scaleUpTimeout))
rc.CleanUp()
expectNoError(waitForClusterSize(f.Client, nodeCount, 20*time.Minute))
expectNoError(waitForClusterSize(f.Client, nodeCount, scaleDownTimeout))
})
It("[Skipped] should scale cluster size based on cpu reservation", func() {
setUpAutoscaler("cpu/node_reservation", 0.5, nodeCount, nodeCount+1)
ReserveCpu(f, "cpu-reservation", 600*nodeCount*coresPerNode)
expectNoError(waitForClusterSize(f.Client, nodeCount+1, 20*time.Minute))
expectNoError(waitForClusterSize(f.Client, nodeCount+1, scaleUpTimeout))
expectNoError(DeleteRC(f.Client, f.Namespace.Name, "cpu-reservation"))
expectNoError(waitForClusterSize(f.Client, nodeCount, 20*time.Minute))
expectNoError(waitForClusterSize(f.Client, nodeCount, scaleDownTimeout))
})
It("[Skipped][Autoscaling Suite] should scale cluster size based on memory utilization", func() {
......@@ -80,20 +85,20 @@ var _ = Describe("Autoscaling", func() {
// Consume 60% of total memory capacity
megabytesPerReplica := int(memCapacityMb * 6 / 10 / coresPerNode)
rc := NewStaticResourceConsumer("mem-utilization", nodeCount*coresPerNode, 0, megabytesPerReplica*nodeCount*coresPerNode, 100, int64(megabytesPerReplica+100), f)
expectNoError(waitForClusterSize(f.Client, nodeCount+1, 20*time.Minute))
expectNoError(waitForClusterSize(f.Client, nodeCount+1, scaleUpTimeout))
rc.CleanUp()
expectNoError(waitForClusterSize(f.Client, nodeCount, 20*time.Minute))
expectNoError(waitForClusterSize(f.Client, nodeCount, scaleDownTimeout))
})
It("[Skipped] should scale cluster size based on memory reservation", func() {
setUpAutoscaler("memory/node_reservation", 0.5, nodeCount, nodeCount+1)
ReserveMemory(f, "memory-reservation", nodeCount*memCapacityMb*6/10)
expectNoError(waitForClusterSize(f.Client, nodeCount+1, 20*time.Minute))
expectNoError(waitForClusterSize(f.Client, nodeCount+1, scaleUpTimeout))
expectNoError(DeleteRC(f.Client, f.Namespace.Name, "memory-reservation"))
expectNoError(waitForClusterSize(f.Client, nodeCount, 20*time.Minute))
expectNoError(waitForClusterSize(f.Client, nodeCount, scaleDownTimeout))
})
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment