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

Error in help: -test.timeout --> ... (default 0, timeout disabled) #30742

Closed
ftjfo opened this issue Mar 11, 2019 · 3 comments
Closed

Error in help: -test.timeout --> ... (default 0, timeout disabled) #30742

ftjfo opened this issue Mar 11, 2019 · 3 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@ftjfo
Copy link

ftjfo commented Mar 11, 2019

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

$ go version

go version go1.12 windows/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

Run
go test -run Mytest -xyz

produces a helptext where the test.timeout is stated to be disabled, when in fact it is 10 minutes

What did you expect to see?

default test.timeout should be 10m

What did you see instead?

It says 'default 0, timeout disabled'
image

@ftjfo ftjfo changed the title -test.timeout --> panic test binary after duration d (default 0, timeout disabled) Error in help: -test.timeout --> ... (default 0, timeout disabled) Mar 11, 2019
@julieqiu
Copy link
Member

@ftjfo, could you provide an example of the code that produced the error, preferably as a Go playground link (https://play.golang.org/). Would you also mind sharing the full output of running go test -run Mytest -xyz?

Additionally, what operating system and processor architecture are you using (go env)?

@julieqiu julieqiu added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 11, 2019
@ftjfo
Copy link
Author

ftjfo commented Mar 11, 2019

timeout = flag.Duration("test.timeout", 0, "panic test binary after duration `d` (default 0, timeout disabled)")

If you look at this code line, and compare with: go help testflag

-timeout d                                                                                                                                                                     
If a test binary runs longer than duration d, panic.                                                                                                                       
If d is 0, the timeout is disabled.                                                                                                                                         
The default is 10 minutes (10m).

@ianlancetaylor
Copy link
Member

If at all possible please cut and paste text. Please don't post screenshot images. Text is much easier to read and understand. Thanks.

The help output you are seeing is coming from the test binary. From the test binary's perspective, that is correct. The ten minute timeout you are referring to is imposed by go test. You are mixing up the test binary flags with the go test flags, which I admit is easy to do since they look the same. I don't think there is anything to change here.

@golang golang locked and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants