RFR [14] 8151678: com/sun/jndi/ldap/LdapTimeoutTest.java failed due to timeout on DeadServerNoTimeoutTest is incorrect

Daniel Fuchs daniel.fuchs at oracle.com
Fri Aug 30 11:28:28 UTC 2019

Hi Pavel,

Looks probably OK ;-)

One thing though is that it's not always guaranteed that
InetAddress.getByName("localhost") will resolve to the same
address than that returned by InetAddess.getLoopbackAddress(),
so it may be better to use the literal address (which may be
an IPv6 literal requiring enclosing "[" "]") rather than
the hostname when building the LDAP URL.

best regards,

-- daniel

On 30/08/2019 11:53, Pavel Rappo wrote:
>                          //
>                          // Dear maintainer:
>                          //
>                          // Once you are done trying to 'optimize' this routine,
>                          // and have realized what a terrible mistake that was,
>                          // please increment the following counter as a warning
>                          // to the next guy:
>                          //
>                          // total_hours_wasted_here = 42
>                          //
>                                                                          --- [1]
> Hello,
> Please review the following change:
>       http://cr.openjdk.java.net/~prappo/8151678/webrev.00/
> Testing timeouts is not an easy task. The test in question has always been
> problematic. There have been many attempts to address the unreliability of that
> test and during its lifetime the test has been tagged (and subsequently
> untagged) as intermittent and eventually was put into the problem list.
> The proposed change overhauls the test and patches the code that the test
> exercises.
> The code change addresses the multithreading issue associated with 8160768 [2].
> This issue manifests itself as different runtime exceptions that are thrown
> rather quickly from calls that the test expects to block for a substantial
> amount of time. Since that test catches this issue reliably, no new tests are
> introduced.
> The overhauled test is excluded from the problem list. Before doing so I had run
> the test on all the platforms for some 40,000 (4.0E4) times. I have not
> encountered any failures.
> And yet I'm under no illusion that this change fixes all the issues. I strongly
> suspect that the test will eventually fail again. I’ve attempted to prepare for
> that by adding extra diagnostic outputs and improving the usefulness of traces.
> -Pavel
> -------------------------------------------------------------------------------
> [1] https://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered
> [2] 8160768: Add capability to custom resolve host/domain names within the default JNDI LDAP provider

More information about the core-libs-dev mailing list