-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Description
81a74b4 introduced a fix that provided additional test information should a test panic and ensured that test output was flushed.
A panicked test is output as a failed test item like any other failure. However, what is not clear from this output or the exit code, is that whilst a failure occurred, no additional tests will then be run.
Consider:
func TestWithPanic(t *testing.T) {
panic("panic during test")
}
func TestEclipsedByPanic(t *testing.T) {
// success, failure?
}Running go test here will immediately exit after TestWithPanic. We know that this test failed, but we don't know that it paniced nor caused additional tests (TestEclipsedByPanic) to not run without delving deeper into the test's output.
Ordinarily, when a test failure occurs, additional tests are still run. By not making it clear that a panic took place, a test reporting tool might assume that the test output contains all successes and failures, but could in fact be missing tests.
A possible solution to this would be to use a different exit code other than 1 to indicate that there wasn't just a regular test failure present, but a completely irrecoverable test run.