]> Cypherpunks repositories - gostls13.git/commit
runtime/race: fix failing tests
authorAustin Clements <austin@google.com>
Mon, 27 Apr 2015 21:15:30 +0000 (17:15 -0400)
committerAustin Clements <austin@google.com>
Mon, 27 Apr 2015 23:12:00 +0000 (23:12 +0000)
commit02ba71e54721f89dcece3f2b439ecea0d06d5802
treec07e800b51890d438d2a6724e01ae79e811659e6
parentf774e6a1f85aa7e2bbdd20b7ef475ed8adbe7bfe
runtime/race: fix failing tests

Some race tests were sensitive to the goroutine scheduling order.
When this changed in commit e870f06, these tests started to fail.

Fix TestRaceHeapParam by ensuring that the racing goroutine has
run before the test exits. Fix TestRaceRWMutexMultipleReaders by
adding a third reader to ensure that two readers wind up on the
same side of the writer (and race with each other) regardless of
the schedule. Fix TestRaceRange by ensuring that the racing
goroutine runs before the main goroutine exits the loop it races
with.

Change-Id: Iaf002f8730ea42227feaf2f3c51b9a1e57ccffdd
Reviewed-on: https://go-review.googlesource.com/9402
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/race/testdata/mop_test.go
src/runtime/race/testdata/rwmutex_test.go