internal/processtest: prevent parallel process testing

Updates #2571
This commit is contained in:
Hajime Hoshi 2023-02-14 18:13:25 +09:00
parent c3709f57b7
commit 397da70815

View File

@ -42,7 +42,11 @@ func TestPrograms(t *testing.T) {
continue
}
// Run tests not in parallel (#2571)
ch := make(chan struct{})
t.Run(n, func(t *testing.T) {
defer close(ch)
cmd := exec.Command("go", "run", filepath.Join(dir, n))
stderr := &bytes.Buffer{}
cmd.Stderr = stderr
@ -50,5 +54,6 @@ func TestPrograms(t *testing.T) {
t.Errorf("%v\n%s", err, stderr)
}
})
<-ch
}
}