Skip to content

Commit 4d5dafd

Browse files
committed
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.
1 parent 1a32a68 commit 4d5dafd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ func runPlatTests(target string, matches []string, t *testing.T) {
7272
t.Parallel()
7373

7474
for _, path := range matches {
75+
path := path // redefine to avoid race condition
76+
7577
switch {
7678
case target == "wasm":
7779
// testdata/gc.go is known not to work on WebAssembly

0 commit comments

Comments
 (0)