Merge pull request #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
This commit is contained in:
Kubernetes Prow Robot 2019-11-06 05:01:51 -08:00 committed by GitHub
commit 0a66404d00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -269,8 +269,11 @@ var _ = SIGDescribe("CronJob", func() {
ginkgo.By("Ensuring a finished job exists by listing jobs explicitly") ginkgo.By("Ensuring a finished job exists by listing jobs explicitly")
jobs, err := f.ClientSet.BatchV1().Jobs(f.Namespace.Name).List(metav1.ListOptions{}) 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) framework.ExpectNoError(err, "Failed to ensure a finished cronjob exists by listing jobs explicitly in namespace %s", f.Namespace.Name)
_, finishedJobs := filterActiveJobs(jobs) activeJobs, finishedJobs := filterActiveJobs(jobs)
framework.ExpectEqual(len(finishedJobs), 1) 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 // Job should get deleted when the next job finishes the next minute
ginkgo.By("Ensuring this job and its pods does not exist anymore") ginkgo.By("Ensuring this job and its pods does not exist anymore")