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

Severin Gehwolf sgehwolf at redhat.com
Tue Sep 1 11:54:05 UTC 2020


On Sat, 2020-08-29 at 09:24 -0400, Zhengyu Gu wrote:
> I would like to backport this patch for parity with Oracle 8u271.
> 
> The original patch does not apply cleanly. The conflicts on the fixes
> are minors, can be easily resolved manually.
> 
> 1) LdapTimeoutTest.java is not in ProblemList.txt in 8u
> 2) Copyright lines in LdapTimeoutTest.java do not match
> 3) Import lines in BaseLdapServer.java do not match
> 
> 
> However, LdapTimeoutTest.java uses some new language features and APIs 
> that do not exist in 8u. It also uses new test library that needs to map 
> back to 8u test library.
> 
>   /*
>    * @test
> - * @library /test/lib
> + * @library /lib/testlibrary
>    *          lib/
>    * @run testng/othervm LdapTimeoutTest
>    * @bug 7094377 8000487 6176036 7056489 8151678
> @@ -59,7 +59,7 @@
>   import static java.lang.String.format;
>   import static java.util.concurrent.TimeUnit.MILLISECONDS;
>   import static java.util.concurrent.TimeUnit.NANOSECONDS;
> -import static jdk.test.lib.Utils.adjustTimeout;
> +import static jdk.testlibrary.Utils.adjustTimeout;
>   import static org.testng.Assert.assertTrue;
>   import static org.testng.Assert.expectThrows;
> 
> @@ -120,7 +120,7 @@
>               executorService.shutdown();
>           }
>           int failedCount = 0;
> -        for (var f : futures) {
> +        for (Future f : futures) {
>               try {
>                   f.get();
>               } catch (ExecutionException e) {
> @@ -283,11 +283,14 @@
> 
>           @Override
>           protected void beforeAcceptingConnections() {
> -            starting.completeAsync(() -> null);
> +            CompletableFuture.supplyAsync(() -> null)
> +                .whenComplete((input, exception) -> {
> +                    starting.complete(null);
> +                });
>           }
> 
>           public CompletableFuture<Void> starting() {
> -            return starting.copy();
> +            return starting.toCompletableFuture();
>           }
>       }
> 
> Test:
>    jdk_other

Could you please post a full webrev URL of the patch?

Thanks,
Severin



More information about the jdk8u-dev mailing list