Skip to content

Timeout Rule replacement #1246

@littleclay

Description

@littleclay

Feature request
We have a large number of end-to-end automation tests that have a dependency on an external resource (e.g. network calls, actual db, etc). There have been times that a test run will get caught up waiting for db locks, etc. In JUnit 4 we solve these problems by using the Timeout rule on a base class that our automation test classes extends. I don't see any way to replicate that behavior in JUnit 5, though.

According to the following comment it sounds like the only current solution is to use the assertions that have a timeout, but this only works for a timeout of the assertion itself, not for other parts of the test method (e.g. during setup).

#343

Deliverable
Have a way of preemptively terminating an executing test at any point in it's lifecycle.

P.S.
I suppose if we had control of the thread executing the tests at an appropriate time (so that the time countdown doesn't include time waiting for the test to actually start executing) as per this issue we could solve this with an extension similarly to how the timeout rule works, but I'm unsure of how much control the actual implementation of this issue will give extension authors.

#20

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