mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Add retry to RC creation in autoscaler e2e
This commit is contained in:
parent
e2633865b1
commit
37c2cfe92c
@ -48,13 +48,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultTimeout = 3 * time.Minute
|
defaultTimeout = 3 * time.Minute
|
||||||
resizeTimeout = 5 * time.Minute
|
resizeTimeout = 5 * time.Minute
|
||||||
scaleUpTimeout = 5 * time.Minute
|
scaleUpTimeout = 5 * time.Minute
|
||||||
scaleUpTriggerTimeout = 2 * time.Minute
|
scaleUpTriggerTimeout = 2 * time.Minute
|
||||||
scaleDownTimeout = 20 * time.Minute
|
scaleDownTimeout = 20 * time.Minute
|
||||||
podTimeout = 2 * time.Minute
|
podTimeout = 2 * time.Minute
|
||||||
nodesRecoverTimeout = 5 * time.Minute
|
nodesRecoverTimeout = 5 * time.Minute
|
||||||
|
rcCreationRetryTimeout = 4 * time.Minute
|
||||||
|
rcCreationRetryDelay = 20 * time.Second
|
||||||
|
|
||||||
gkeEndpoint = "https://test-container.sandbox.googleapis.com"
|
gkeEndpoint = "https://test-container.sandbox.googleapis.com"
|
||||||
gkeUpdateTimeout = 15 * time.Minute
|
gkeUpdateTimeout = 15 * time.Minute
|
||||||
@ -771,10 +773,18 @@ func ReserveMemory(f *framework.Framework, id string, replicas, megabytes int, e
|
|||||||
Replicas: replicas,
|
Replicas: replicas,
|
||||||
MemRequest: request,
|
MemRequest: request,
|
||||||
}
|
}
|
||||||
err := framework.RunRC(*config)
|
for start := time.Now(); time.Since(start) < rcCreationRetryTimeout; time.Sleep(rcCreationRetryDelay) {
|
||||||
if expectRunning {
|
err := framework.RunRC(*config)
|
||||||
framework.ExpectNoError(err)
|
if err != nil && strings.Contains(err.Error(), "Error creating replication controller") {
|
||||||
|
glog.Warningf("Failed to create memory reservation: %v", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if expectRunning {
|
||||||
|
framework.ExpectNoError(err)
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
framework.Failf("Failed to reserve memory within timeout")
|
||||||
}
|
}
|
||||||
|
|
||||||
// WaitForClusterSize waits until the cluster size matches the given function.
|
// WaitForClusterSize waits until the cluster size matches the given function.
|
||||||
|
Loading…
Reference in New Issue
Block a user