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.
Этот коммит содержится в:
родитель
1a32a68674
коммит
4d5dafd360
1 изменённых файлов: 2 добавлений и 0 удалений
|
@ -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
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче