Integrated: 8287062: com/sun/jndi/ldap/LdapPoolTimeoutTest.java failed due to different timeout message

Jaikiran Pai jpai at openjdk.org
Mon Dec 15 13:39:34 UTC 2025


On Tue, 9 Dec 2025 15:49:36 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review of this test-only change which proposes to address the intermittent failures in `com/sun/jndi/ldap/LdapPoolTimeoutTest.java`?
> 
> As noted in https://bugs.openjdk.org/browse/JDK-8287062, this test fails intermittently. This test was introduced in https://bugs.openjdk.org/browse/JDK-8277795 with the goal to verify that the LDAP connection timeout was honoured when concurrent connections were attempted. The test itself is simple and launches the LDAP connection attempts concurrently and expects each attempt to fail with an exception. In order to verify that the failure is for the right reasons, it tries its best to check the exception type and exception message. If they don't match the exception messages this test knows of, the exception is propagated to fail the test.
> 
> It so happens that different parts of LDAP connection management code and some other parts of java.net.Socket code might emit different exception messages and in some cases the java.net.Socket might emit the right exception type but without any exception message. Some of the recent sightings of this test failure have this stacktrace:
> 
> 
> javax.naming.CommunicationException: example.com:1234 [Root exception is java.net.SocketTimeoutException]
> 	at java.naming/com.sun.jndi.ldap.Connection.<init>(Connection.java:251)
> 	at java.naming/com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:136)
> 	at java.naming/com.sun.jndi.ldap.LdapClientFactory.createPooledConnection(LdapClientFactory.java:71)
> 	at java.naming/com.sun.jndi.ldap.pool.Connections.createConnection(Connections.java:184)
> 	at java.naming/com.sun.jndi.ldap.pool.Connections.getAvailableConnection(Connections.java:150)
> 	at java.naming/com.sun.jndi.ldap.pool.Pool.getOrCreatePooledConnection(Pool.java:196)
> 	at java.naming/com.sun.jndi.ldap.pool.Pool.getPooledConnection(Pool.java:152)
> 	at java.naming/com.sun.jndi.ldap.LdapPoolManager.getLdapClient(LdapPoolManager.java:339)
> 	...
> 	at java.naming/javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:130)
> 	at LdapPoolTimeoutTest.lambda$attemptConnect$0(LdapPoolTimeoutTest.java:114)
> 	at LdapTimeoutTest.lambda$assertCompletion$0(LdapTimeoutTest.java:361)
> 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:330)
> 	at java.base/java.lang.Thread.run(Thread.java:1516)
> Caused by: java.net.SocketTimeoutException
> 	at java.base/java.net.SocksSocketImpl.remainingMillis(SocksSocketImpl.java:93)
> 	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:28...

This pull request has now been integrated.

Changeset: 1f47294c
Author:    Jaikiran Pai <jpai at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/1f47294cd336db34030ea16132490ab51310ace5
Stats:     64 lines in 1 file changed: 28 ins; 13 del; 23 mod

8287062: com/sun/jndi/ldap/LdapPoolTimeoutTest.java failed due to different timeout message

Reviewed-by: aefimov

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

PR: https://git.openjdk.org/jdk/pull/28725


More information about the core-libs-dev mailing list