]> Cypherpunks repositories - gostls13.git/commit
runtime/race: run tests with GOMAXPROCS=1
authorDmitry Vyukov <dvyukov@google.com>
Wed, 27 Jan 2016 18:22:28 +0000 (19:22 +0100)
committerRuss Cox <rsc@golang.org>
Wed, 27 Jan 2016 20:49:36 +0000 (20:49 +0000)
commit572f7660a774ebd8552408a6058b36cc90f6f563
tree635b05ea9130f6ded5621a525a77bbd9eac5ecef
parentd326a9641994eccdac1c95901762af45ec801bf1
runtime/race: run tests with GOMAXPROCS=1

We set GOMAXPROCS=1 to prevent test flakiness.
There are two sources of flakiness:
1. Some tests rely on particular execution order.
   If the order is different, race does not happen at all.
2. Ironically, ThreadSanitizer runtime contains a logical race condition
   that can lead to false negatives if racy accesses happen literally at the same time.
Tests used to work reliably in the good old days of GOMAXPROCS=1.
So let's set it for now. A more reliable solution is to explicitly annotate tests
with required execution order by means of a special "invisible" synchronization primitive
(that's what is done for C++ ThreadSanitizer tests). This is issue #14119.

This reduces flakes on RaceAsFunc3 test from 60/3000 to 1/3000.

Fixes #14086
Fixes #14079
Fixes #14035

Change-Id: Ibaec6b2b21e27b62563bffbb28473a854722cf41
Reviewed-on: https://go-review.googlesource.com/18968
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/race/output_test.go
src/runtime/race/race_test.go