diff --git a/framework/job.go b/framework/job.go index 40a61be3..c72fd0cc 100644 --- a/framework/job.go +++ b/framework/job.go @@ -101,7 +101,7 @@ func (f *Framework) GetJobPodList(jb *batchv1.Job) (*corev1.PodList, error) { return pods, nil } -// WaitJobFinished wait for all job pod finish , no matter succceed or fail +// WaitJobFinished wait for all job pod finish , no matter succeed or fail func (f *Framework) WaitJobFinished(jobName, namespace string, ctx context.Context) (*batchv1.Job, bool, error) { for { select { diff --git a/framework/pod.go b/framework/pod.go index 2ad128f7..fadd5afe 100644 --- a/framework/pod.go +++ b/framework/pod.go @@ -245,7 +245,7 @@ func (f *Framework) GetPodListByLabel(label map[string]string) (*corev1.PodList, } func (f *Framework) CheckPodListRunning(podList *corev1.PodList) bool { - if podList == nil { + if podList == nil || len(podList.Items) == 0 { return false } for _, item := range podList.Items {