Skip to content

proposal: testing: timeouts for each or a particular test #44442

Description

@honDhan

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

$ go version
go version go1.15.6 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you expect to see?

Similar to #10529.
Proposal: add a test-specific timeout

For CI pipelines and other use cases, it's useful to have a test-specific timeout instead of a timeout for the whole run.
For example, it would be nice to specify a timeout of 10s for each test. This way, more tests can be added without having to reconfigure the -timeout.

Additionally, it would also be nice to be able to pass a test even after timing out. This way, you can set different test-specific timeouts to adjust which tests run.

Activity

  1. changed the title [-]testing: timeouts for each or a particular test[/-] [+]proposal: timeouts for each or a particular test[/+] on Feb 19, 2021
  2. added this to the Proposal milestone on Feb 19, 2021
  3. ianlancetaylor commented on Feb 20, 2021

    @ianlancetaylor
    Contributor

    Can you make some specific proposals for how this should work? Thanks.

  4. kivilahtio commented on Apr 19, 2021

    @kivilahtio

    It would be best to have a timeout wrapper as a part of the test suite, so something like:

    /// return true, or fail the test
    t.Timeout(10*time.Millis, func() {
    // do the agitation of the particle
    }, "Description of the test, eg 'agitate the space-schitzoid to reach boiling point in the certified duration'")

    But writing a wrapper is not that difficult:
    https://stackoverflow.com/questions/24929790/how-to-set-the-go-timeout-flag-on-go-test

  5. changed the title [-]proposal: timeouts for each or a particular test[/-] [+]proposal: testing: timeouts for each or a particular test[/+] on Apr 19, 2021
  6. ianlancetaylor commented on Apr 19, 2021

    @ianlancetaylor
    Contributor

    I don't see how to implement t.Timeout. What should happen when the timeout expires?

  7. added
    WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
    on Apr 19, 2021
  8. gopherbot commented on May 19, 2021

    @gopherbot
    Contributor

    Timed out in state WaitingForInfo. Closing.

    (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

  9. DmitriyMV commented on Nov 16, 2021

    @DmitriyMV
    Contributor
  10. moved this to Declined in Proposalson Aug 10, 2022
  11. removed this from Proposalson Oct 19, 2022
  12. locked and limited conversation to collaborators on Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeProposalWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions