Skip to content

Commit 0a66404

Browse files
authored
Merge pull request kubernetes#84838 from justinsb/if_gomega_had_meant_us_to_understand_test_failures_it_would_have_given_pigs_wings
e2e: Provide more helpful error output for failing test
2 parents 76d04cf + e3a9d6f commit 0a66404

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/e2e/apps/cronjob.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,11 @@ var _ = SIGDescribe("CronJob", func() {
269269
ginkgo.By("Ensuring a finished job exists by listing jobs explicitly")
270270
jobs, err := f.ClientSet.BatchV1().Jobs(f.Namespace.Name).List(metav1.ListOptions{})
271271
framework.ExpectNoError(err, "Failed to ensure a finished cronjob exists by listing jobs explicitly in namespace %s", f.Namespace.Name)
272-
_, finishedJobs := filterActiveJobs(jobs)
273-
framework.ExpectEqual(len(finishedJobs), 1)
272+
activeJobs, finishedJobs := filterActiveJobs(jobs)
273+
if len(finishedJobs) != 1 {
274+
framework.Logf("Expected one finished job in namespace %s; activeJobs=%v; finishedJobs=%v", f.Namespace.Name, activeJobs, finishedJobs)
275+
framework.ExpectEqual(len(finishedJobs), 1)
276+
}
274277

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

0 commit comments

Comments
 (0)