diff --git a/test/e2e/framework/ginkgowrapper/wrapper.go b/test/e2e/framework/ginkgowrapper/wrapper.go index 97ccbd896c0..6bbdb5d6177 100644 --- a/test/e2e/framework/ginkgowrapper/wrapper.go +++ b/test/e2e/framework/ginkgowrapper/wrapper.go @@ -37,8 +37,18 @@ type FailurePanic struct { FullStackTrace string // A full stack trace starting at the source of the failure } +const ginkgoFailurePanic = ` +Your test failed. +Ginkgo panics to prevent subsequent assertions from running. +Normally Ginkgo rescues this panic so you shouldn't see it. +But, if you make an assertion in a goroutine, Ginkgo can't capture the panic. +To circumvent this, you should call + defer GinkgoRecover() +at the top of the goroutine that caused this panic. +` + // String makes FailurePanic look like the old Ginkgo panic when printed. -func (FailurePanic) String() string { return ginkgo.GINKGO_PANIC } +func (FailurePanic) String() string { return ginkgoFailurePanic } // Fail wraps ginkgo.Fail so that it panics with more useful // information about the failure. This function will panic with a diff --git a/test/e2e/framework/skipper/skipper.go b/test/e2e/framework/skipper/skipper.go index 87f621b1127..99d506e0a8f 100644 --- a/test/e2e/framework/skipper/skipper.go +++ b/test/e2e/framework/skipper/skipper.go @@ -56,8 +56,18 @@ type SkipPanic struct { FullStackTrace string // A full stack trace starting at the source of the failure } +const ginkgoSkipPanic = ` +Your test was skipped. +Ginkgo panics to prevent subsequent assertions from running. +Normally Ginkgo rescues this panic so you shouldn't see it. +But, if you make an assertion in a goroutine, Ginkgo can't capture the panic. +To circumvent this, you should call + defer GinkgoRecover() +at the top of the goroutine that caused this panic. +` + // String makes SkipPanic look like the old Ginkgo panic when printed. -func (SkipPanic) String() string { return ginkgo.GINKGO_PANIC } +func (SkipPanic) String() string { return ginkgoSkipPanic } // Skip wraps ginkgo.Skip so that it panics with more useful // information about why the test is being skipped. This function will