Skip to content

proposal: testing: should Context() have a deadline? #74631

Description

@teo-tsirpanis

Proposal Details

Go 1.24 added a standard way to get a context inside a test, however even though there is a function to get the Deadline of a test, its Context does not have this deadline set. Should it?

In some tests of mine we've been setting a timeout of 20 seconds for HTTP requests, which makes debugging challenging if you forget to temporarily remove the timeout. Having a uniform and unbotrusive way of flowing the deadline to tests would greatly help.

Activity

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions