diff options
| author | cui fliter <imcusg@gmail.com> | 2022-11-18 14:06:56 +0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-02-21 23:07:55 +0000 |
| commit | dd87e33d88eadaf5302895fb91b0a0e2e16b136e (patch) | |
| tree | bc87d8e3a3291c51a7046009ff9ba4205f707450 /src/os/exec/exec_test.go | |
| parent | 34e701ece2138ebb8276c2d413a6ea1ee1ed84a4 (diff) | |
| download | go-dd87e33d88eadaf5302895fb91b0a0e2e16b136e.tar.xz | |
os: use testenv.Command instead of exec.Command in tests
testenv.Command sets a default timeout based on the test's deadline
and sends SIGQUIT (where supported) in case of a hang.
Change-Id: I84d469d12ca1f39175b713ca41e7cd2202d11d96
Reviewed-on: https://go-review.googlesource.com/c/go/+/451895
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/os/exec/exec_test.go')
| -rw-r--r-- | src/os/exec/exec_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index 67e2d256b4..c2f643a645 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -752,7 +752,7 @@ func TestExtraFiles(t *testing.T) { tempdir := t.TempDir() exe := filepath.Join(tempdir, "read3.exe") - c := exec.Command(testenv.GoToolPath(t), "build", "-o", exe, "read3.go") + c := testenv.Command(t, testenv.GoToolPath(t), "build", "-o", exe, "read3.go") // Build the test without cgo, so that C library functions don't // open descriptors unexpectedly. See issue 25628. c.Env = append(os.Environ(), "CGO_ENABLED=0") |
