diff options
| author | Ian Lance Taylor <iant@golang.org> | 2017-08-18 12:58:08 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2017-08-18 21:10:46 +0000 |
| commit | fbf7e1f2952fba64af0fae32c760cf5011eca53e (patch) | |
| tree | e36241a17122d47b8671e51b3c8d1b590482dca1 /src/runtime/race | |
| parent | 21312a4b5ef42670dfb1d5d38d8a9e4e97cf13a8 (diff) | |
| download | go-fbf7e1f2952fba64af0fae32c760cf5011eca53e.tar.xz | |
[release-branch.go1.9] testing: don't fail all tests after racy test failure
The code was adding race.Errors to t.raceErrors before checking
Failed, but Failed was using t.raceErrors+race.Errors. We don't want
to change Failed, since that would affect tests themselves, so modify
the harness to not unnecessarily change t.raceErrors.
Updates #19851
Fixes #21338
Change-Id: I483f27c68c340928f1cbdef160abc0a5716efb5d
Reviewed-on: https://go-review.googlesource.com/57151
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/race')
| -rw-r--r-- | src/runtime/race/output_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/runtime/race/output_test.go b/src/runtime/race/output_test.go index e73e6b3bfc..13dfc33b47 100644 --- a/src/runtime/race/output_test.go +++ b/src/runtime/race/output_test.go @@ -259,4 +259,25 @@ Goroutine [0-9] \(running\) created at: runtime\.newextram\(\) .*/runtime/proc.go:[0-9]+ \+0x[0-9,a-f]+ ==================`}, + {"second_test_passes", "test", "", "atexit_sleep_ms=0", ` +package main_test +import "testing" +func TestFail(t *testing.T) { + done := make(chan bool) + x := 0 + go func() { + x = 42 + done <- true + }() + x = 43 + <-done +} + +func TestPass(t *testing.T) { +} +`, ` +================== +--- FAIL: TestFail \(0...s\) +.*testing.go:.*: race detected during execution of test +FAIL`}, } |
