Skip to content

cmd/go: unable to disable test timeout #14780

@cpuguy83

Description

@cpuguy83

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    1.6
  2. What operating system and processor architecture are you using (go env)?
    linux/amd64
  3. What did you do?

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:

if dt, err := time.ParseDuration(testTimeout); err == nil && dt > 0 {

If the main timeout is not > 0, it just stays at the default 10m.

  1. What did you expect to see?
    The test timeout should be able to be be disabled.
  2. What did you see instead?
    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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions