Skip to content

testing: timeout docs for "go test -h" are ambiguous #20090

@kevinburke

Description

@kevinburke

"go test -h" says this about timeouts:

	-timeout t
	    If a test runs longer than t, panic.
	    The default is 10 minutes (10m).

"A test" is ambiguous in this context. I took it to mean "A single test", that is, "Each test has a timeout of t". Test runners in other languages usually default to this behavior for tests. However, the flag output indicates the timeout covers the entire test run, not individual tests.

	timeout              = flag.Duration("test.timeout", 0, "fail test binary execution after duration `d` (0 means unlimited)")

This also tripped up at least one person recently in the #golang-newbies Slack channel. It would be good if the output was clear that the timeout covers the entire test run, not individual tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions