]> Cypherpunks repositories - gostls13.git/commit
runtime/race: deflake test
authorDmitry Vyukov <dvyukov@google.com>
Mon, 9 May 2016 13:11:24 +0000 (15:11 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Mon, 9 May 2016 14:50:18 +0000 (14:50 +0000)
commitaeecee8ce4cf1821dcb6b5e37e20f40696278498
treef6ac8ea9c01a766572cf9f68579d10d87072d852
parent87a2ae1fa25677dc9097a25292c54b7b9dac2c9d
runtime/race: deflake test

The test sometimes fails on builders.
The test uses sleeps to establish the necessary goroutine
execution order. If sleeps undersleep/oversleep
the race is still reported, but it can be reported when the
main test goroutine returns. In such case test driver
can't match the race with the test and reports failure.

Wait for both test goroutines to ensure that the race
is reported in the test scope.

Fixes #15579

Change-Id: I0b9bec0ebfb0c127d83eb5325a7fe19ef9545050
Reviewed-on: https://go-review.googlesource.com/22951
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/race/testdata/chan_test.go