From b418e040f415be72c717c5f804b45c39d3fb9337 Mon Sep 17 00:00:00 2001 From: robm Date: Tue, 25 Aug 2015 14:15:50 +0100 Subject: [PATCH] 8046768: com/sun/jndi/ldap/LdapTimeoutTest.java fails intermittently Reviewed-by: vinnie --- test/com/sun/jndi/ldap/LdapTimeoutTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/com/sun/jndi/ldap/LdapTimeoutTest.java b/test/com/sun/jndi/ldap/LdapTimeoutTest.java index 9a5580028..7c64ebb4a 100644 --- a/test/com/sun/jndi/ldap/LdapTimeoutTest.java +++ b/test/com/sun/jndi/ldap/LdapTimeoutTest.java @@ -83,6 +83,10 @@ abstract class LdapTest implements Callable { 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(); @@ -231,7 +235,7 @@ class DeadServerTimeoutSSLTest extends DeadServerTest { // SocketTimeoutException pass(); } else { - fail(); + fail(e); } } } @@ -268,7 +272,8 @@ class ReadServerTimeoutTest extends ReadServerTest { } 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(); -- GitLab