-
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: stack unavailable when a parallel test times out #18042
Comments
For the sake of completeness, this is what the stack trace looks when it happens to be alright:
|
I have a vague memory that setting |
That's right (setting GOTRACEBACK=crash will print all backtraces) but I
agree
this is not documented because it doesn't work on all platforms.
(More detailed explanations: with GOTRACEBACK=crash, because it's going
to crash anyway, the runtime can send signals to each thread and ask it to
dump stack trace. But this implementation obviously don't work on systems
without async signals.)
|
Maybe the |
Frustratingly, this happens 100% of the time when I do:
Surely this one is fixable? If |
Running tests involves a fair amount of machinery. Running everything on the main thread is a hard enough problem that testing.M was introduced in large part to enable it. So the fix here is going to have to be general, not particular to the value of |
For future reference, I ended up opening #19280 for forcing parallel tests to run sequentially. |
Duplicate of #13161. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
Ran
go test -short -timeout 1s
with a new test case that I knew was going to loop forever and time out (trying to fix it).What did you expect to see?
The
go test
timeout being hit and the panic with a useful stack trace shown.What did you see instead?
Note that this doesn't happen all the time. It happens often, though - about half of the times I run
go test
.I don't know if this is by design. I can see the cause - the use of
t.Parallel()
- but I don't think its use should have this inconvenient.The text was updated successfully, but these errors were encountered: