mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 10:37:46 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user