-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: unable to disable test timeout #14780
Comments
What is the difference between disabling the timeout and using a very high value? That is, why doesn't setting a very high value solve your problem? |
It works, but doesn't feel right. |
What are you suggesting that we do? Note that I would vote against anything that involves adding another option to |
I agree on not adding another option. Currently the code checks if the timeout is zero and then sets the fallback if it's not. |
I suppose that is OK with me. Want to send a patch? |
Sorry yes, I've been putting this off until I have a chance to digest the contribution process. |
CL https://golang.org/cl/45631 mentions this issue. |
I don't see any argument for changing the meaning of -timeout=0 when -timeout=1000h already does what you want and is much clearer about the effect. |
@rsc The |
@ianlancetaylor, that text about timeout=0 does not appear in Go 1.8 docs. I will revert whatever introduced it in the Go 1.9 cycle. Thanks. |
CL https://golang.org/cl/47571 mentions this issue. |
The text before CL 45816 was: -timeout t If a test runs longer than t, panic. The default is 10 minutes (10m). CL 45816 was supposed to be about clarifying test vs test binary, and it did add the clarification of referring to "duration d", but it also introduced incorrect text about timeout 0. The new text in this CL preserves the good change and eliminates the incorrect one: -timeout d If a test binary runs longer than duration d, panic. The default is 10 minutes (10m). For #14780. Change-Id: I4f79d6e48ed9295bc9f34a36aa90d3b03b40d7f5 Reviewed-on: https://go-review.googlesource.com/47571 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@rsc I introduced the incorrect text about timeout=0 while trying to make the docs consistent with: flag.Duration("test.timeout", 0, "panic test binary after duration `d` (0 means unlimited)") Line 268 in bb3be40
Is the text in the flag also incorrect or have I misunderstood something here? |
I think I've answered my own question by running some tests.
The asymmetry seems confusing. |
Yes, running under the go command is different from running a test binary by hand. I left the issue open (the CL did not say Fix) because I want to think more about this in Go 1.10. The thing is, no one would ever say -test.timeout=0 when invoking a binary by hand, because that's the default. It may be that the right fix to the binary doc is to change
to
There's still the fact that the go command default is different from a test binary's default, but that seems at least plausibly defensible. Anyway, at least the docs are correct for Go 1.9. |
Change https://golang.org/cl/81499 mentions this issue: |
Please answer these questions before submitting your issue. Thanks!
go version
)?1.6
go env
)?linux/amd64
go test
timeouts are implemented in 2 ways:There is the main timeout which just calls
panic
when the timeout is reached.This timeout can be disabled when you set a value less than 1
A secondary timeout is set as a failsafe which calls SIGQUIT to dump a stacktrace and then exits.
This is set to the main timeout value + 1 minute:
go/src/cmd/go/test.go
Line 409 in 9323de3
If the main timeout is not > 0, it just stays at the default 10m.
The test timeout should be able to be be disabled.
The secondary timeout is in place even when no timeout is set and there is no way to disable.
We use a test helper that wraps testing.T to provide its own functionality, like setup/teardown tests.
This means the entire suite uses a single testing.T. With that, means the only way to not have go kill our integration tests is to set an really high value for the timeout (which I think also defeats the purpose of the timeout to begin with).
The text was updated successfully, but these errors were encountered: