From: Ian Lance Taylor Date: Thu, 19 May 2022 19:10:38 +0000 (-0700) Subject: cmd/dist: pass a -test.timeout option to a host test X-Git-Tag: go1.19beta1~161 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=dd83fd8a70d324be96d2fcac753b202db0625538;p=gostls13.git cmd/dist: pass a -test.timeout option to a host test For a host test we build the test using "go test -c" and then run the test binary. A test binary run in this way has no default timeout. This CL gives it a timeout of 5 minutes, scaled for the target. We can adjust the timeout if necessary. For #52998 Change-Id: Ib759142f3e71cbb37ec858182998fc5d4fba7ab6 Reviewed-on: https://go-review.googlesource.com/c/go/+/407374 TryBot-Result: Gopher Robot Reviewed-by: Michael Knyszek Reviewed-by: Bryan Mills Run-TryBot: Ian Lance Taylor --- diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 817ea4a7c5..677be336ac 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -1181,7 +1181,7 @@ func (t *tester) runHostTest(dir, pkg string) error { if err := cmd.Run(); err != nil { return err } - return t.dirCmd(dir, f.Name(), "-test.short="+short()).Run() + return t.dirCmd(dir, f.Name(), "-test.short="+short(), "-test.timeout="+t.timeoutDuration(300).String()).Run() } func (t *tester) cgoTest(dt *distTest) error {