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

cmd/go: go test timeout doesn't take into account count #17337

Closed
carl-mastrangelo opened this issue Oct 4, 2016 · 5 comments
Closed

cmd/go: go test timeout doesn't take into account count #17337

carl-mastrangelo opened this issue Oct 4, 2016 · 5 comments

Comments

@carl-mastrangelo
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.7.1

When running a large number of tests or benchmarks, the test timeout in src/cmd/go/test.go is hard coded to 10 minutes

This means that the -test.count parameter is not taken into account, when in fact it should be.

@quentinmit quentinmit changed the title tools/cmd: go test timeout doesn't take into account count cmd/go: go test timeout doesn't take into account count Oct 4, 2016
@quentinmit
Copy link
Contributor

You can already override the timeout with -timeout. I don't think it makes sense to just multiply the -timeout by -count because you'd very quickly get into unfeasibly long timeouts.

@carl-mastrangelo
Copy link
Contributor Author

@quentinmit In the case of benchmark, I really do want to wait the full length. Some benchmarks have to be run with high counts to get good accuracy. It's annoying to add the timeout every time.

Please reconsider opening this bug.

@dsnet
Copy link
Member

dsnet commented Oct 4, 2016

Duplicate of #12446

@davecheney
Copy link
Contributor

A possible workaround is to use go test -c, then run the resulting
$PKG.test -test.timeout=NNNs -test.count=NNN binary.

On Wed, Oct 5, 2016 at 9:54 AM, Carl Mastrangelo notifications@github.com
wrote:

@quentinmit https://github.com/quentinmit In the case of benchmark, I
really do want to wait the full length. Some benchmarks have to be run with
high counts to get good accuracy. It's annoying to add the timeout every
time.

Please reconsider opening this bug.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#17337 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAcA7CuTa7m5TAVkc3qT8D8R9OaoQCvks5qwtk0gaJpZM4KOEgv
.

@carl-mastrangelo
Copy link
Contributor Author

carl-mastrangelo commented Oct 4, 2016

@davecheney it's risky, because if the timer is even off by a little, it would fire too early (and also ignores the -test.benchtime). It would be better to not have a work around at all, and the test runner do the right thing by default.

My own version was just to set the timeout to 20 hours, which is arguably not good either. @dsnet mentioned in his bug that it isn't straightforward, but I think it should still be solved (by me maybe, if there is agreement that it's a problem).

@golang golang locked and limited conversation to collaborators Oct 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants