]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/race: ignore user GORACE env var in tests
authorDmitry Vyukov <dvyukov@google.com>
Fri, 28 Oct 2016 22:53:49 +0000 (00:53 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Sat, 29 Oct 2016 01:32:26 +0000 (01:32 +0000)
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 <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/race/race_test.go

index 9323168299ec9e6c983eb01a61bf70d2f1331ccc..8f910bf008ad6f5763862578f03058fa81fe8c19 100644 (file)
@@ -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)