Run runs f as a subtest of t called name. It runs f in a separate goroutine and blocks until f returns or calls t.Parallel to become a parallel test. Run reports whether f succeeded (or at least did not fail before calling t.Parallel).
Run may be called simultaneously from multiple goroutines, but all such calls must return before the outer test function for t returns.
#22993 also bit me, and led to the code in this example that deadlocks.
I don't think the doc update is sufficient. There is still a critical bit of information missing:
its execution is suspended until its calling test function, that of the parent test, has returned.
Feedback is required from experts, contributors, and/or the community before a change can be made.
Issue is not actionable because of missing required information, which needs to be provided.
Apr 26, 2018
What version of Go are you using (
go version go1.9.2 darwin/amd64
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
What did you do?
go test -vwith the following code:
What did you expect to see?
All statements print and test completes
What did you see instead?
Test hangs after "deferred done" and "waiting" are printed.
This is explained by the following comment in the blog post introducing subtests.
But I cannot find this mentioned anywhere in the documentation for the
It seems like we at least need to update those docs with the appropriate details.
The text was updated successfully, but these errors were encountered: