]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/race: fix test for GOMAXPROCS>1
authorAlbert Strasheim <fullung@gmail.com>
Thu, 13 Dec 2012 06:14:32 +0000 (10:14 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Thu, 13 Dec 2012 06:14:32 +0000 (10:14 +0400)
Fixes #4530.

R=dvyukov, dave
CC=golang-dev
https://golang.org/cl/6933052

src/pkg/runtime/race/race_test.go

index b97eb43870ff38592b17732cf17ca577e41179c6..fac06616fc17acfc89c78bc6612597433dca17b0 100644 (file)
@@ -146,7 +146,13 @@ func runTests() ([]byte, error) {
        // The following flags turn off heuristics that suppress seemingly identical reports.
        // 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).
-       cmd.Env = append(os.Environ(), `GORACE="suppress_equal_stacks=0 suppress_equal_addresses=0"`)
+       for _, env := range os.Environ() {
+               if strings.HasPrefix(env, "GOMAXPROCS=") {
+                       continue
+               }
+               cmd.Env = append(cmd.Env, env)
+       }
+       cmd.Env = append(cmd.Env, `GORACE="suppress_equal_stacks=0 suppress_equal_addresses=0"`)
        ret, _ := cmd.CombinedOutput()
        return ret, nil
 }