main: fix race condition in tests

This caused most tests to run the zeroalloc.go test instead of what they
should have been tested, and in turn explains most of the performance
gains of parallel testing.

This commit fixes it by avoiding race conditions. Luckily, no tests
started failing since then due to this.
This commit is contained in:
Ayke van Laethem
2020-01-14 16:22:20 +01:00
committed by Ayke
parent 1a32a68674
commit 4d5dafd360
+2
View File
@@ -72,6 +72,8 @@ func runPlatTests(target string, matches []string, t *testing.T) {
t.Parallel()
for _, path := range matches {
path := path // redefine to avoid race condition
switch {
case target == "wasm":
// testdata/gc.go is known not to work on WebAssembly