I want to have something like this:
long timeout = isDebugModeActive() ? Long.MAX_VALUE : 10000;
So that when the debugger stops on a breakpoint the timeouts do not take place.
Is there any API or System/Environment property to find it out?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The author of this thread found this solution:
A standard disclaimer seem appropriate, though – this is pretty brittle (in that it is very specific in when it is triggered) and can lead to Heisenbugs (bugs which don’t appear when you’re trying to debug). For many scenarios, a system property or environment variable is probably better.