-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
testing: panics during a test quietly interrupt additional test runs #47525
Comments
If all tests are run, then the test emits a final
|
Thank you @bcmills It appears that test2json adds the {"Time":"2021-08-04T18:52:47.136312+01:00","Action":"output","Package":"example.com/m","Output":"FAIL\n"} If using |
Closing as there doesn't seem to be anything to be done. Note |
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:
Running
go test
here will immediately exit afterTestWithPanic
. 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.The text was updated successfully, but these errors were encountered: