mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
Merge pull request #136076 from kannon92/fix-flake-mutable-job
[flake] wait for job suspended condition for JobMutable test cases
This commit is contained in:
@@ -4392,23 +4392,14 @@ func TestUpdateJobPodResources(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to suspend Job: %v", err)
|
||||
}
|
||||
|
||||
}
|
||||
if tc.suspend || tc.startThenSuspend {
|
||||
// Wait for the job to be suspended
|
||||
err = wait.PollUntilContextTimeout(ctx, time.Second, wait.ForeverTestTimeout, true, func(ctx context.Context) (bool, error) {
|
||||
j, err := jobClient.Get(ctx, job.Name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return j.Spec.Suspend != nil && *j.Spec.Suspend, nil
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to wait for job to be suspended: %v", err)
|
||||
}
|
||||
waitForPodsToBeActive(ctx, t, jobClient, 0, job)
|
||||
validateJobCondition(ctx, t, cs, job, batchv1.JobSuspended)
|
||||
t.Logf("job is suspended")
|
||||
}
|
||||
|
||||
waitForPodsToBeActive(ctx, t, jobClient, 0, job)
|
||||
|
||||
if tc.updateResources {
|
||||
_, err := updateJob(ctx, jobClient, job.Name, func(j *batchv1.Job) {
|
||||
for i := range j.Spec.Template.Spec.Containers {
|
||||
|
||||
Reference in New Issue
Block a user