mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 21:53:52 +00:00
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.
This commit is contained in:
@@ -2095,6 +2095,11 @@ func (config *RCConfig) start() error {
|
||||
// Simplified version of RunRC, that does not create RC, but creates plain Pods.
|
||||
// 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) {
|
||||
// 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
|
||||
for i := 0; i < replicas; i++ {
|
||||
podName := fmt.Sprintf("%v-%v", podNamePrefix, i)
|
||||
|
Reference in New Issue
Block a user