diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index bd02149c115..554adea1b17 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -405,6 +405,9 @@ func (opts *goTest) buildArgs(t *tester) (build, run, pkgs, testFlags []string, if opts.timeout != 0 { d := opts.timeout * time.Duration(t.timeoutScale) run = append(run, "-timeout="+d.String()) + } else if t.timeoutScale != 1 { + const goTestDefaultTimeout = 10 * time.Minute // Default value of go test -timeout flag. + run = append(run, "-timeout="+(goTestDefaultTimeout*time.Duration(t.timeoutScale)).String()) } if opts.short || t.short { run = append(run, "-short") diff --git a/src/cmd/go/internal/test/testflag.go b/src/cmd/go/internal/test/testflag.go index 970c2f59e9a..425378889d9 100644 --- a/src/cmd/go/internal/test/testflag.go +++ b/src/cmd/go/internal/test/testflag.go @@ -61,7 +61,7 @@ func init() { cf.String("run", "", "") cf.Bool("short", false, "") cf.String("skip", "", "") - cf.DurationVar(&testTimeout, "timeout", 10*time.Minute, "") + cf.DurationVar(&testTimeout, "timeout", 10*time.Minute, "") // known to cmd/dist cf.String("fuzztime", "", "") cf.String("fuzzminimizetime", "", "") cf.StringVar(&testTrace, "trace", "", "")