From 894abb5f680c040777f17f9f8ee5a5ab3a03cb94 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 29 Oct 2016 00:53:49 +0200 Subject: [PATCH] runtime/race: ignore user GORACE env var in tests I did 'export GORACE=atexit_sleep_ms=0' in a console and then was puzzled as to why race tests fail. Existing GORACE env var may (or may not) override the one that we setup. Filter out GORACE as we do for other important env vars. Change-Id: I29be86b0cbb9b5dc7f9efb15729ade86fc79b0e0 Reviewed-on: https://go-review.googlesource.com/32163 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/runtime/race/race_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/race/race_test.go b/src/runtime/race/race_test.go index 9323168299..8f910bf008 100644 --- a/src/runtime/race/race_test.go +++ b/src/runtime/race/race_test.go @@ -154,7 +154,9 @@ func runTests(t *testing.T) ([]byte, error) { // It is required because the tests contain a lot of data races on the same addresses // (the tests are simple and the memory is constantly reused). for _, env := range os.Environ() { - if strings.HasPrefix(env, "GOMAXPROCS=") || strings.HasPrefix(env, "GODEBUG=") { + if strings.HasPrefix(env, "GOMAXPROCS=") || + strings.HasPrefix(env, "GODEBUG=") || + strings.HasPrefix(env, "GORACE=") { continue } cmd.Env = append(cmd.Env, env) -- 2.50.0