Commit d4529867 authored by Russ Cox's avatar Russ Cox

testing: define Run result a little more clearly

t.Run(f) does not wait for f after f calls t.Parallel.
Otherwise it would be impossible to create new
parallel sibling subtests for f.

Fixes #22993.

Change-Id: I27e1555ab1ff608eb8155db261d5e7ee8f486aef
Reviewed-on: https://go-review.googlesource.com/83880
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 2c296dc8
...@@ -781,9 +781,9 @@ func tRunner(t *T, fn func(t *T)) { ...@@ -781,9 +781,9 @@ func tRunner(t *T, fn func(t *T)) {
t.finished = true t.finished = true
} }
// Run runs f as a subtest of t called name. It reports whether f succeeded. Run // Run runs f as a subtest of t called name. It runs f in a separate goroutine
// runs f in a separate goroutine and will block until all its parallel subtests // and blocks until f returns or calls t.Parallel to become a parallel test.
// have completed. // 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 // Run may be called simultaneously from multiple goroutines, but all such calls
// must return before the outer test function for t returns. // must return before the outer test function for t returns.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment