Hi Chris, This looks fine to me too. Thanks for taking care of this issue.
A potential issue I see is that the test might fail if "localhost" does not resolve to the loopback address - but you would likely get a "Connection refused" in that case. One possibility to get that out of the way could be to use the URIBuilder: * @library lib/ /test/lib ... URI providerURI = URIBuilder.newBuilder() .scheme("ldap") .loopback() .port(server.getLocalPort()) .path("/o=example") .build(); ... 59 env.put(Context.PROVIDER_URL, providerURI.toString()); best regards, -- daniel On 13/03/2020 08:28, Chris Yin wrote:
Hello, Please review following changes to try to fix intermittent failure of test com/sun/jndi/ldap/RemoveNamingListenerTest.java, thanks Bug: https://bugs.openjdk.java.net/browse/JDK-8202117 Webrev: http://cr.openjdk.java.net/~xyin/8202117/webrev.00/ According to failure logs, test already run done and give a pass message, but test framework caught “java.lang.RuntimeException: java.net.SocketException: Connection reset” from other thread during test end, go through the test code, LDAPServerHandler thread may throw such exception in specific case. This change will replace test itself implemented TestLDAPServer/LDAPServerHandler with customized BaseLdapServer to fix the corner. I had run the changed test on 4 platforms for total 600 times, no failure observed. Thanks, Chris