mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Merge pull request #53057 from aleksandra-malinowska/autoscaling-test-fix-8
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. In autoscaling tests, add waiting for new pool to become ready This adds missing timeout when adding a node pool in GKE scale to 0 test and improves logging error when enabling autoscaling.
This commit is contained in:
commit
0ebe86019c
@ -623,11 +623,12 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
||||
// Determine whether we want to run & adjust the setup if necessary
|
||||
if len(originalSizes) < 2 {
|
||||
if framework.ProviderIs("gke") {
|
||||
By("Adding a new node pool")
|
||||
const extraPoolName = "extra-pool"
|
||||
addNodePool(extraPoolName, "n1-standard-4", 1)
|
||||
defer deleteNodePool(extraPoolName)
|
||||
err := enableAutoscaler(extraPoolName, 0, 1)
|
||||
framework.ExpectNoError(err)
|
||||
framework.ExpectNoError(framework.WaitForReadyNodes(c, nodeCount+1, resizeTimeout))
|
||||
framework.ExpectNoError(enableAutoscaler(extraPoolName, 0, 1))
|
||||
} else {
|
||||
framework.Skipf("At least 2 node groups are needed for scale-to-0 tests")
|
||||
}
|
||||
@ -831,12 +832,15 @@ func enableAutoscaler(nodePool string, minCount, maxCount int) error {
|
||||
glog.Infof("Config update result: %s", putResult)
|
||||
}
|
||||
|
||||
var finalErr error
|
||||
for startTime := time.Now(); startTime.Add(gkeUpdateTimeout).After(time.Now()); time.Sleep(30 * time.Second) {
|
||||
if val, err := isAutoscalerEnabled(minCount); err == nil && val {
|
||||
val, err := isAutoscalerEnabled(minCount)
|
||||
if err == nil && val {
|
||||
return nil
|
||||
}
|
||||
finalErr = err
|
||||
}
|
||||
return fmt.Errorf("autoscaler not enabled")
|
||||
return fmt.Errorf("autoscaler not enabled, last error: %v", finalErr)
|
||||
}
|
||||
|
||||
func disableAutoscaler(nodePool string, minCount, maxCount int) error {
|
||||
|
Loading…
Reference in New Issue
Block a user