RFR JDK-8059311: com/sun/jndi/ldap/LdapTimeoutTest.java fails with exit_code == 0

Pavel Rappo pavel.rappo at oracle.com
Fri Nov 7 12:14:53 UTC 2014

Hi everyone,

Could you please review my change for JDK-8059311?


It looks like one of the "killSwitches" went off and executed System.exit(0). The problem is jtreg doesn't like System.exit and treats it as a test failure (http://openjdk.java.net/jtreg/faq.html#question7.1):

"...Tests are not allowed to call System.exit because the test must have the ability to run in the same JVM as the harness. Calling System.exit while the test is running in this manner would cause the harness itself to exit..."

Moreover, the purpose of the "killSwitch" is not clear. It seems to be ensuring the test won't hang by killing JVM after a certain timeout.
First of all, if the test hangs -- it means we have a problem to investigate and the "killSwitch" is just masking it. If it doesn't hang -- there's no need for a "killSwitch". 

If the test hangs it will be noticed by jtreg (http://openjdk.java.net/jtreg/tag-spec.txt):

"...    /timeout=<seconds>

Specify the timeout value.  The default timeout is two minutes.  If an action
does not finish before the timeout expires, it fails..."

Thus if we remove the "killSwitch" we treat the problem of slow systems (where killSwitch timeout was too small) and at the same time will be notified if test hangs.


More information about the core-libs-dev mailing list