Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 161568 - When debugging into a @Test(timeout=xxx) method, the debugging session ends after the timeout
When debugging into a @Test(timeout=xxx) method, the debugging session ends a...
Status: RESOLVED WONTFIX
Product: debugger
Classification: Unclassified
Component: Java
6.x
All Linux
: P3 with 1 vote (vote)
: TBD
Assigned To: Martin Entlicher
issues@debugger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-31 11:57 UTC by cbliard
Modified: 2014-10-21 21:43 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments

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.
See https://github.com/junit-team/junit/issues/738
Comment 6 Martin Entlicher 2014-10-21 21:43:16 UTC
DisableOnDebug rule was introduced. See https://github.com/junit-team/junit/pull/956
This can be used to turn off timeouts during debugging since JUnit 4.12:

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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo