• Austin Clements's avatar
    runtime/race: fix failing tests · 02ba71e5
    Austin Clements authored
    Some race tests were sensitive to the goroutine scheduling order.
    When this changed in commit e870f06c, 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/9402Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    02ba71e5
rwmutex_test.go 2.07 KB