Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to ignore timeouts #738

Closed
entlicher opened this issue Sep 17, 2013 · 8 comments
Closed

Add an option to ignore timeouts #738

entlicher opened this issue Sep 17, 2013 · 8 comments

Comments

@entlicher
Copy link

When debugging JUnit tests, they often fails with timeout exception, when timeouts are set for individual methods via @test(timeout=...) annotations. It would be valuable, when debugger could set an option to ignore all test timeouts.
See e.g.: https://netbeans.org/bugzilla/show_bug.cgi?id=161568

@dsaff
Copy link
Member

dsaff commented Sep 17, 2013

Can you elaborate? What kind of mechanism would JUnit provide? This isn't
unique to JUnit--any process that spawns a thread and kills it if it seems
to be taking too long would have a similar problem.

David

On Tue, Sep 17, 2013 at 11:58 AM, entlicher notifications@github.comwrote:

When debugging JUnit tests, they often fails with timeout exception, when
timeouts are set for individual methods via @Testhttps://github.com/Test(timeout=...)
annotations. It would be valuable, when debugger could set an option to
ignore all test timeouts.
See e.g.: https://netbeans.org/bugzilla/show_bug.cgi?id=161568


Reply to this email directly or view it on GitHubhttps://github.com//issues/738
.

@snargleplax
Copy link

It could support a command-line option or system property to disable all test timeouts. IDE plugins and build scripts could optionally provide that option when debugging.

@kcooney
Copy link
Member

kcooney commented Oct 21, 2014

@snargleplax does #956 solve this problem for you?

@entlicher
Copy link
Author

Thanks for the DisableOnDebug rule. It's more generic than just timeout handling.
On the other hand, users need to think about it and use it when they write the test. A command-line option could be set by debuggers when launching the test and users would not have to care about it.
Ideally, the time that elaps while the test is suspended by the debugger should be subtracted from the execution time when handling the timeout, but I understand that such a solution is likely out of scope for JUnit.
Maybe, it would be valuable when the timeout is hit and you detect that it's running in a debug mode, print out a suggestion to use DisableOnDebug rule.

@snargleplax
Copy link

@kcooney Yes, thanks for the pointer to that. I updated to 4.12-beta-2 and was able to get the behavior I want from DisableOnDebug.

@kcooney
Copy link
Member

kcooney commented Oct 22, 2014

IDEs and build tools don't use our code to parse flags, so using flags isn't a great option. We could enable features via system properties, but some of the maintainers aren't thrilled with configuration via system properties, and you would have to remember to setup your IDE to set the system property anyway.

If the disable-on-debug feature works well, we could enable it my default in a future JUnit release.

@entlicher
Copy link
Author

O.K. Thanks for your comments. And for the DisableOnDebug.

@marcphilipp
Copy link
Member

Closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants