]> Cypherpunks repositories - gostls13.git/commitdiff
testing: move comment inside T.Parallel
authorRuss Cox <rsc@golang.org>
Tue, 29 Dec 2015 17:10:01 +0000 (12:10 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 6 Jan 2016 17:59:55 +0000 (17:59 +0000)
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>
src/testing/testing.go

index c33a997372c682f719b8863228c78b948efa20b8..e4c4772fed2a8fc91cfaa5c1109257887a189b97 100644 (file)
@@ -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