Commit aaed6cbc authored by Daniel S. Fava's avatar Daniel S. Fava Committed by Bryan C. Mills
Browse files

testing/race: fixing intermittent test failure

Test NoRaceMutexPureHappensBefore in runtime/race/testdata/mutex_test.go
expects the second spawned goroutine to run after the first.  The test
attempts to force this scheduling with a 10 millisecond wait.  Following
a suggestion by Bryan Mills, we force this scheduling using a shared
variable whose access take place within the existing mutex.

Fixes #35745.

Change-Id: Ib23ec51492ecfeed4752e020401dd25755a669ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/291292


Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
parent fbed561f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment