aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-12-29 12:10:01 -0500
committerRuss Cox <rsc@golang.org>2016-01-06 17:59:55 +0000
commitf034b62c85ebe17a3fc4ab54edc30994cc8c8b70 (patch)
tree69053abe5d775df0e07937aec0d09ed71f4379ca /src/testing/testing.go
parentaec2f0cf855ac2d2b79ca3178dcd9f63c0b5afb0 (diff)
downloadgo-f034b62c85ebe17a3fc4ab54edc30994cc8c8b70.tar.xz
testing: move comment inside T.Parallel
This was supposed to be in CL 18204 but I submitted from the web instead of my computer and lost this final edit. Change-Id: I41598e936bb088d77f5e44752eda74222a4208c7 Reviewed-on: https://go-review.googlesource.com/18310 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/testing/testing.go')
-rw-r--r--src/testing/testing.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go
index c33a997372..e4c4772fed 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -428,13 +428,14 @@ func (c *common) Skipped() bool {
// Parallel signals that this test is to be run in parallel with (and only with)
// other parallel tests.
func (t *T) Parallel() {
- // We don't want to include the time we spend waiting for serial tests
- // in the test duration. Record the elapsed time thus far and reset the
- // timer afterwards.
if t.isParallel {
panic("testing: t.Parallel called multiple times")
}
t.isParallel = true
+
+ // We don't want to include the time we spend waiting for serial tests
+ // in the test duration. Record the elapsed time thus far and reset the
+ // timer afterwards.
t.duration += time.Since(t.start)
t.signal <- (*T)(nil) // Release main testing loop
<-t.startParallel // Wait for serial tests to finish