mirror of
https://github.com/golang/go
synced 2024-11-22 02:54:39 -07:00
cmd/cgo/internal/testcarchive: remove 1-minute timeout
The 1-minute test timeout seems a bit arbitrary. Use internal/testenv.Command, which applies t.Deadline to subcommand. For #67566. Change-Id: If84c96e353bdfaf02c9b123758198e031305ae32 Reviewed-on: https://go-review.googlesource.com/c/go/+/599056 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
parent
fc51e5023e
commit
8c88f0c736
@ -1224,7 +1224,7 @@ func TestManyCalls(t *testing.T) {
|
||||
}
|
||||
|
||||
argv := cmdToRun("./testp7")
|
||||
cmd = exec.Command(argv[0], argv[1:]...)
|
||||
cmd = testenv.Command(t, argv[0], argv[1:]...)
|
||||
sb := new(strings.Builder)
|
||||
cmd.Stdout = sb
|
||||
cmd.Stderr = sb
|
||||
@ -1232,14 +1232,6 @@ func TestManyCalls(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
timer := time.AfterFunc(time.Minute,
|
||||
func() {
|
||||
t.Error("test program timed out")
|
||||
cmd.Process.Kill()
|
||||
},
|
||||
)
|
||||
defer timer.Stop()
|
||||
|
||||
err = cmd.Wait()
|
||||
t.Logf("%v\n%s", cmd.Args, sb)
|
||||
if err != nil {
|
||||
@ -1284,7 +1276,7 @@ func TestPreemption(t *testing.T) {
|
||||
}
|
||||
|
||||
argv := cmdToRun("./testp8")
|
||||
cmd = exec.Command(argv[0], argv[1:]...)
|
||||
cmd = testenv.Command(t, argv[0], argv[1:]...)
|
||||
sb := new(strings.Builder)
|
||||
cmd.Stdout = sb
|
||||
cmd.Stderr = sb
|
||||
@ -1292,14 +1284,6 @@ func TestPreemption(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
timer := time.AfterFunc(time.Minute,
|
||||
func() {
|
||||
t.Error("test program timed out")
|
||||
cmd.Process.Kill()
|
||||
},
|
||||
)
|
||||
defer timer.Stop()
|
||||
|
||||
err = cmd.Wait()
|
||||
t.Logf("%v\n%s", cmd.Args, sb)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user