]> Cypherpunks repositories - gostls13.git/commit
testing: add T.Context method
authorBrad Fitzpatrick <bradfitz@golang.org>
Sat, 22 Oct 2016 14:25:21 +0000 (07:25 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 3 Nov 2016 21:14:30 +0000 (21:14 +0000)
commit26827bc2fe4c80dc68b3793631d24975425c9467
tree81440e2915ad87e699fc1dbf255a573ffb157e64
parent606f81eef37e5a232f43a208f6eeaddd82dadf34
testing: add T.Context method

From the doc comment:

Context returns the context for the current test or benchmark.
The context is cancelled when the test or benchmark finishes.
A goroutine started during a test or benchmark can wait for the
context's Done channel to become readable as a signal that the
test or benchmark is over, so that the goroutine can exit.

Fixes #16221.
Fixes #17552.

Change-Id: I657df946be2c90048cc74615436c77c7d9d1226c
Reviewed-on: https://go-review.googlesource.com/31724
Reviewed-by: Rob Pike <r@golang.org>
src/go/build/deps_test.go
src/testing/benchmark.go
src/testing/sub_test.go
src/testing/testing.go
src/testing/testing_test.go