From 3e1519d05a640701e1a2f1d9ba737fc912a1b624 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 15 Nov 2022 10:45:00 -0500 Subject: [PATCH] cmd/pack: 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: Ia1dd1bacfa2c9378401bbce304ebf7ee3f159352 Reviewed-on: https://go-review.googlesource.com/c/go/+/450707 Run-TryBot: Bryan Mills TryBot-Result: Gopher Robot Auto-Submit: Bryan Mills Reviewed-by: Ian Lance Taylor --- src/cmd/pack/pack_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cmd/pack/pack_test.go b/src/cmd/pack/pack_test.go index ed241a0b5e4..be757380935 100644 --- a/src/cmd/pack/pack_test.go +++ b/src/cmd/pack/pack_test.go @@ -12,7 +12,6 @@ import ( "io" "io/fs" "os" - "os/exec" "path/filepath" "strings" "sync" @@ -410,7 +409,7 @@ func TestRWithNonexistentFile(t *testing.T) { // doRun runs a program in a directory and returns the output. func doRun(t *testing.T, dir string, args ...string) string { - cmd := exec.Command(args[0], args[1:]...) + cmd := testenv.Command(t, args[0], args[1:]...) cmd.Dir = dir out, err := cmd.CombinedOutput() if err != nil {