Commit 1f6711ca authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #25192 from ingvagabund/e2e-framework-util-start-pods-dont-wait-for-zero-pods

Automatic merge from submit-queue e2e/framework/util.StartPods: don't wait for pods that are not created When running ``[k8s.io] SchedulerPredicates [Serial] validates resource limits of pods that are allowed to run [Conformance]`` pods can be created in a way in which additional pods have to be create to fully saturate node's capacity CPU in a cluster. Additional pods are created by calling ``framework.StartPods``. The function creates pods with a given label and waits for them (if ``waitForRunning`` is ``true``). This is fine as long as the number of pods to created is non-zero. If there are zero pods to be created and ``waitForRunning`` is ``true``, the function waits forever as there is not going to be any pods with requested label. Thus, resulting in ``Error waiting for 0 pods to be running - probably a timeout``. Causing the e2e test to fail even if it should not. Adding condition to return from the function immediately if there is not pod to create.
parents f5e1e9a2 59fc509f
...@@ -2095,6 +2095,11 @@ func (config *RCConfig) start() error { ...@@ -2095,6 +2095,11 @@ func (config *RCConfig) start() error {
// Simplified version of RunRC, that does not create RC, but creates plain Pods. // Simplified version of RunRC, that does not create RC, but creates plain Pods.
// optionally waits for pods to start running (if waitForRunning == true) // optionally waits for pods to start running (if waitForRunning == true)
func StartPods(c *client.Client, replicas int, namespace string, podNamePrefix string, pod api.Pod, waitForRunning bool) { func StartPods(c *client.Client, replicas int, namespace string, podNamePrefix string, pod api.Pod, waitForRunning bool) {
// no pod to start
if replicas < 1 {
Logf("No pod to start, skipping...")
return
}
startPodsID := string(util.NewUUID()) // So that we can label and find them startPodsID := string(util.NewUUID()) // So that we can label and find them
for i := 0; i < replicas; i++ { for i := 0; i < replicas; i++ {
podName := fmt.Sprintf("%v-%v", podNamePrefix, i) podName := fmt.Sprintf("%v-%v", podNamePrefix, i)
......
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