8046768: com/sun/jndi/ldap/LdapTimeoutTest.java fails intermittently
authorrobm
Tue, 25 Aug 2015 14:15:50 +0100
changeset 32272 107a28901a7b
parent 32271 d6cb1602f271
child 32273 de3cc06aec56
8046768: com/sun/jndi/ldap/LdapTimeoutTest.java fails intermittently Reviewed-by: vinnie
jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java
--- a/jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java	Tue Aug 25 14:07:08 2015 +0100
+++ b/jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java	Tue Aug 25 14:15:50 2015 +0100
@@ -84,6 +84,10 @@
         throw new RuntimeException("Test failed");
     }
 
+    public void fail(Exception e) {
+        throw new RuntimeException("Test failed", e);
+    }
+
     boolean shutItDown(InitialContext ctx) {
         try {
             if (ctx != null) ctx.close();
@@ -232,7 +236,7 @@
             // SocketTimeoutException
             pass();
         } else {
-            fail();
+            fail(e);
         }
     }
 }
@@ -269,7 +273,8 @@
     }
 
     public void handleNamingException(NamingException e, long start, long end) {
-        if (NANOSECONDS.toMillis(end - start) < 2_900) {
+        System.out.println("ReadServerTimeoutTest: end-start=" + NANOSECONDS.toMillis(end - start));
+        if (NANOSECONDS.toMillis(end - start) < 2_500) {
             fail();
         } else {
             pass();