From 40e1e2e93eaa7d42cc2a3c9ff813710d36cace51 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 15 Nov 2022 10:14:41 -0500 Subject: [PATCH] cmd/internal/goobj: 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: I464dc34b50f3360123aca9e8666df9799c15e457 Reviewed-on: https://go-review.googlesource.com/c/go/+/450701 Run-TryBot: Bryan Mills Auto-Submit: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- src/cmd/internal/goobj/objfile_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cmd/internal/goobj/objfile_test.go b/src/cmd/internal/goobj/objfile_test.go index d7eb0b194b6..10e0564a590 100644 --- a/src/cmd/internal/goobj/objfile_test.go +++ b/src/cmd/internal/goobj/objfile_test.go @@ -11,7 +11,6 @@ import ( "internal/buildcfg" "internal/testenv" "os" - "os/exec" "testing" "cmd/internal/bio" @@ -125,7 +124,7 @@ func TestIssue41621LargeNumberOfRelocations(t *testing.T) { w.Reset() // Build. - cmd := exec.Command(testenv.GoToolPath(t), "build", "-o", "large") + cmd := testenv.Command(t, testenv.GoToolPath(t), "build", "-o", "large") cmd.Dir = tmpdir out, err := cmd.CombinedOutput() if err != nil {