From 515e3de2999b23da28e6d15ac485bfdd299ec83a Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Wed, 5 Oct 2022 15:21:06 -0400 Subject: os/exec: parallelize more tests This cuts the wall duration for 'go test os/exec' and 'go test -race os/exec' roughly in half on my machine, which is an even more significant speedup with a high '-count'. For better or for worse, it may also increase the repro rate of #34988. Tests that use Setenv or Chdir or check for FDs opened during the test still cannot be parallelized, but they are only a few of those. Change-Id: I8d284d8bff05787853f825ef144aeb7a4126847f Reviewed-on: https://go-review.googlesource.com/c/go/+/439196 TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Run-TryBot: Bryan Mills Auto-Submit: Bryan Mills --- src/os/exec/exec_windows_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/os/exec/exec_windows_test.go') diff --git a/src/os/exec/exec_windows_test.go b/src/os/exec/exec_windows_test.go index 35ae0b0b8a..9dec72b3e1 100644 --- a/src/os/exec/exec_windows_test.go +++ b/src/os/exec/exec_windows_test.go @@ -33,6 +33,8 @@ func cmdPipeHandle(args ...string) { } func TestPipePassing(t *testing.T) { + t.Parallel() + r, w, err := os.Pipe() if err != nil { t.Error(err) @@ -60,6 +62,8 @@ func TestPipePassing(t *testing.T) { } func TestNoInheritHandles(t *testing.T) { + t.Parallel() + cmd := exec.Command("cmd", "/c exit 88") cmd.SysProcAttr = &syscall.SysProcAttr{NoInheritHandles: true} err := cmd.Run() @@ -76,6 +80,7 @@ func TestNoInheritHandles(t *testing.T) { // with a copy of the parent's SYSTEMROOT. // (See issue 25210.) func TestChildCriticalEnv(t *testing.T) { + t.Parallel() cmd := helperCommand(t, "echoenv", "SYSTEMROOT") // Explicitly remove SYSTEMROOT from the command's environment. -- cgit v1.3