I refer to https://github.com/junit-team/junit/wiki/Timeout-for-tests
If I use
@Rule public Timeout globalTimeout = Timeout.seconds(10); @Test(timeout=20000) public void testWithTimeout() { ... } the test schould timeout afer 20s but it times out after 10s