-
Notifications
You must be signed in to change notification settings - Fork 127
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
Inconsistent output when logging after failure #441
Comments
Thank you for the bug report! This is unfortunately a bug with https://pkg.go.dev/cmd/test2json parsing the test output. In the past I've reported a few of these to https://github.com/golang/go, but I think using If you try running this test case with I think many test suites have started to avoid |
Hm. Maybe I'm misunderstanding how it is working then. |
Oh I just realized what you meant when looking at the test with |
When longer running tests run in parallel and are printing things after a test has called
t.Fail()
the log output is very inconsistent. They always get cut off at some point soon aftert.Fail()
was called, but there will be different amount of logs each time. Sometimes there are even logs from other tests being added to the output of the failed test which was a real head-scratcher before realizing what was happening.Test case to reproduce the issue:
Example output:
Here the last two logs and the defer are missing from the
TestFoo
output, and for some reason the last log and the defer fromTestBar
are included.Increasing the loop to print 100 times will also show the fact that the cut-off is random. I have seem it cut off anywhere between 7 and 97 runs in the loop.
The text was updated successfully, but these errors were encountered: