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

Open
josharian opened this issue Jul 4, 2015 · 2 comments
Open

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

josharian opened this issue Jul 4, 2015 · 2 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@josharian
Copy link
Contributor

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
@chadwhitacre
Copy link

Can this be closed with 7f1ff65?

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

go/test/run.go

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])
}

go/test/run.go

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:
cmd.Process.Kill()
err = <-done
// err = errors.New("Test timeout")
}
tick.Stop()

@ianlancetaylor
Copy link
Contributor

I think @josharian is asking for a default timeout.

@ALTree ALTree added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants