Repository navigation
proposal: testing: timeouts for each or a particular test #44442
Description
Activity
- changed the title
[-]testing: timeouts for each or a particular test[/-][+]proposal: timeouts for each or a particular test[/+]on Feb 19, 2021 Can you make some specific proposals for how this should work? Thanks.
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- changed the title
[-]proposal: timeouts for each or a particular test[/-][+]proposal: testing: timeouts for each or a particular test[/+]on Apr 19, 2021 I don't see how to implement
t.Timeout. What should happen when the timeout expires?- addedWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.Issue is not actionable because of missing required information, which needs to be provided.
on Apr 19, 2021 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.)
@honDhan just FYI cmd/go: add per-test timeouts was accepted.
- locked and limited conversation to collaborators
on Nov 16, 2022
What version of Go are you using (
go version)?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.