This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 161568 - When debugging into a @Test(timeout=xxx) method, the debugging session ends after the timeout
Summary: When debugging into a @Test(timeout=xxx) method, the debugging session ends a...
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All Linux
: P3 blocker with 1 vote (vote)
Assignee: Martin Entlicher
Depends on:
Reported: 2009-03-31 11:57 UTC by cbliard
Modified: 2014-10-21 21:43 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description cbliard 2009-03-31 11:57:23 UTC
When debugging a test method defined with a timeout like this

@Test(timeout = 5000)
public void testFoo() {
    // stuff

Then, when debugging into the method, the timeout runs and junit stops the current debugging thread when the timeout
expires. If I want to debug the test, then I need to comment the timeout part and to run the test again.

Is it possible to disable this timeout when such a test is runned ?
Comment 1 mjr_1974 2009-04-16 14:47:48 UTC
I faced this problem way too many times too, specially when debugging multithreaded applications... I fully support
dissabling the timeout of the test that is being debugged.
Comment 2 Yulia Novozhilova 2011-04-25 14:46:28 UTC
Ondra, could you please take a look. I'm not sure where it should be fixed.
Comment 3 Martin Entlicher 2011-04-26 15:03:28 UTC
We'd have to run the JUnit with timeouts disabled, or disable the timeout just specifically for the test method that happens to be suspended by debugger (but this might not be really possible).
Disabling timeouts globally can change the test results.
Comment 4 Martin Entlicher 2013-03-08 19:02:04 UTC
Please, do not change the version to a newer value. It should always represent the oldest version where the bog was found or for which the enhancement was submitted.
7.3.1 does not even exist yet.
Comment 5 Martin Entlicher 2013-09-17 16:00:22 UTC
There's currently no way to ignore all timeouts. Use the workaround to comment-out the timeout before debugging.
Comment 6 Martin Entlicher 2014-10-21 21:43:16 UTC
DisableOnDebug rule was introduced. See
This can be used to turn off timeouts during debugging since JUnit 4.12:

     public TestRule timeout = new DisableOnDebug(new Timeout(1000));