Skip to content

[RFC] Spec timeouts #13928

Open
Open
@straight-shoota

Description

@straight-shoota

Spec examples are individual pieces of work and by their nature very deterministic. Their execution characteristics are usually relatively predictable.
For example, most typical unit tests should complete within a couple of milliseconds, it not less. If a spec takes significantly longer than the usual time, it's an indicator that something is odd. Sometimes spec code gets messed up and will never complete. It may even lead to the entire process hanging up and never completing.
A timout for limiting execution time on single examples could prevent that.

We're already running stdlib's spec suite with a - considerably generous - timeout for every single spec when builing with -Dpreview_mt (see #9865). This shoots down any spec if it gets tangled up.

As previously mentioned in #12860 it might be a good idea to elevate this timeout to a proper feature of the spec library, used in all environments. It surely could be useful in other general scenarios as well.

For reference

Design details (e.g. API and default configuration) are up to further exploration.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions