Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add per-test timeout to run.go #11598

josharian opened this issue Jul 4, 2015 · 2 comments

test: add per-test timeout to run.go #11598

josharian opened this issue Jul 4, 2015 · 2 comments


Copy link

@josharian josharian commented Jul 4, 2015

On the SSA branch, after fixing some other issues, the compiler hangs while compiling ken/label.go. This causes run.go to run forever. Let's add a per-test time limit, even if it is high, so we don't ever spin forever.

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jul 10, 2015
@rsc rsc modified the milestones: Unplanned, Go1.6 Nov 5, 2015
Copy link

@chadwhitacre chadwhitacre commented Oct 25, 2017

Can this be closed with 7f1ff65?

modifications to test/run.go to deal with timeout and killing looping test.


Lines 510 to 516 in eb7e845

case "-t": // timeout in seconds
args = args[1:]
var err error
tim, err = strconv.Atoi(args[0])
if err != nil {
t.err = fmt.Errorf("need number of seconds for -t timeout, got %s instead", args[0])


Lines 559 to 572 in eb7e845

tick := time.NewTimer(time.Duration(tim) * time.Second)
done := make(chan error)
go func() {
done <- cmd.Wait()
select {
case err = <-done:
// ok
case <-tick.C:
err = <-done
// err = errors.New("Test timeout")

Copy link

@ianlancetaylor ianlancetaylor commented Oct 25, 2017

I think @josharian is asking for a default timeout.

@ALTree ALTree added the NeedsFix label Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.