Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: Provide more helpful error output for failing test #84838

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions test/e2e/apps/cronjob.go
Expand Up @@ -269,8 +269,11 @@ var _ = SIGDescribe("CronJob", func() {
ginkgo.By("Ensuring a finished job exists by listing jobs explicitly")
jobs, err := f.ClientSet.BatchV1().Jobs(f.Namespace.Name).List(metav1.ListOptions{})
framework.ExpectNoError(err, "Failed to ensure a finished cronjob exists by listing jobs explicitly in namespace %s", f.Namespace.Name)
_, finishedJobs := filterActiveJobs(jobs)
framework.ExpectEqual(len(finishedJobs), 1)
activeJobs, finishedJobs := filterActiveJobs(jobs)
if len(finishedJobs) != 1 {
framework.Logf("Expected one finished job in namespace %s; activeJobs=%v; finishedJobs=%v", f.Namespace.Name, activeJobs, finishedJobs)
framework.ExpectEqual(len(finishedJobs), 1)
}

// Job should get deleted when the next job finishes the next minute
ginkgo.By("Ensuring this job and its pods does not exist anymore")
Expand Down