RFR: 8251188: Update LDAP tests not to use wildcard addresses [v2]

Aleksei Efimov aefimov at openjdk.java.net
Thu Sep 24 23:48:38 UTC 2020


On Tue, 22 Sep 2020 13:39:38 GMT, Aleksei Efimov <aefimov at openjdk.org> wrote:

>> test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java line 171:
>> 
>>> 169:             System.err.println("Server socket. Failure to accept connection:");
>>> 170:             e.printStackTrace();
>>> 171:         }
>> 
>> I wonder if removing the while (true) loop will make the test more susceptible of failing in timeout if the server ever
>> receives a connection request from an unexpected client (we've seen that happening in the past with networking tests).
>> Is there anyway the server could attempt to verify that the accepted socket is from the expected client, and close it
>> and go back to accepting if it's not? Maybe by looking at the accepted socket remote address & port?
>
> Thanks for the good suggestion Daniel. I will modify it to look at the remote socket's address.

Hi Daniel,

Could you please take a look at the new version of DeadSSLLdapTimeoutTest.java with the following modifications:
**DeadServerTimeoutSSLTest** test was modified to use custom **SocketFactory** (**DeadSSLSocketFactory**) which tracks
  the first opened socket on LDAP client side. This socket is later used on server side to check if the connection
  initiated by test's LDAP client. If the connection was not established by LDAP client then new accept attempt is
  performed.

The test was never seen to fail during 200+ concurrent LDAP tests runs.

-------------

PR: https://git.openjdk.java.net/jdk/pull/252


More information about the core-libs-dev mailing list