• Brad Fitzpatrick's avatar
    testing: add T.Context method · 26827bc2
    Brad Fitzpatrick authored
    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/31724Reviewed-by: 's avatarRob Pike <r@golang.org>
    26827bc2
benchmark.go 17.6 KB