On Mon, 20 Apr 2026 16:04:28 GMT, Matthew Donovan <[email protected]> wrote:

>> This timeout may be caused by different code paths used to resolve 
>> `InetAddress.getLoopbackAddress()` in the server thread and 
>> `factory.createSocket("localhost",...)` in the client thread. I updated the 
>> test to use getLoopbackAddress() for both threads.
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Matthew Donovan has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains three additional 
> commits since the last revision:
> 
>  - updated test to enable server thread to exit quickly if client has 
> connection error
>  - Merge branch 'master' into disable-cipher-suites
>  - 8374454: Test 
> sun/security/ssl/CipherSuite/DisabledCipherSuitesNotNegotiated.java from 
> JDK-8356544 shows intermittent timeouts

Changes requested by rhalade (Reviewer).

test/jdk/sun/security/ssl/CipherSuite/DisabledCipherSuitesNotNegotiated.java 
line 36:

> 34: import java.nio.charset.StandardCharsets;
> 35: import java.nio.file.Path;
> 36: import java.nio.file.Files;

Suggestion:

import java.nio.file.Files;
import java.nio.file.Path;

test/jdk/sun/security/ssl/CipherSuite/DisabledCipherSuitesNotNegotiated.java 
line 46:

> 44: import jdk.test.lib.security.SecurityUtils;
> 45: import jdk.test.lib.process.ProcessTools;
> 46: import jdk.test.lib.process.OutputAnalyzer;

Suggestion:

import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;

test/jdk/sun/security/ssl/CipherSuite/DisabledCipherSuitesNotNegotiated.java 
line 58:

> 56:     private static final String TLS_PROTOCOL = "TLSv1.2";
> 57:     private static volatile int serverPort = 0;
> 58:     private static volatile Exception serverException = null;

Suggestion:

test/jdk/sun/security/ssl/CipherSuite/DisabledCipherSuitesNotNegotiated.java 
line 82:

> 80:             serverSocket.setSoTimeout(1000);
> 81:             SSLSocket clientSocket = null;
> 82:             waitForServer.countDown();while (clientSocket == null) {

Suggestion:

            waitForServer.countDown();
            while (clientSocket == null) {

test/jdk/sun/security/ssl/CipherSuite/DisabledCipherSuitesNotNegotiated.java 
line 84:

> 82:             waitForServer.countDown();while (clientSocket == null) {
> 83:                 try {
> 84:                     clientSocket = (SSLSocket)serverSocket.accept();

Suggestion:

                    clientSocket = (SSLSocket) serverSocket.accept();

test/jdk/sun/security/ssl/CipherSuite/DisabledCipherSuitesNotNegotiated.java 
line 112:

> 110:         InetAddress address = InetAddress.getLoopbackAddress();
> 111:         System.out.println("CLIENT: Connecting to " + address);
> 112:         try(SSLSocket socket = (SSLSocket)factory.createSocket(address, 
> portNumber)) {

Suggestion:

        try(SSLSocket socket = (SSLSocket) factory.createSocket(address, 
portNumber)) {

test/jdk/sun/security/ssl/CipherSuite/DisabledCipherSuitesNotNegotiated.java 
line 150:

> 148: 
> 149:     private static void runTest(final boolean disabledInClient) throws 
> Exception {
> 150:         try(ExecutorService executorService = 
> Executors.newFixedThreadPool(2)) {

Suggestion:

        try (ExecutorService executorService = Executors.newFixedThreadPool(2)) 
{

test/jdk/sun/security/ssl/CipherSuite/DisabledCipherSuitesNotNegotiated.java 
line 161:

> 159:                     System.out.println("Server Exception:");
> 160:                     exc.printStackTrace(System.out);
> 161:                     serverException = exc;

Suggestion:

test/jdk/sun/security/ssl/CipherSuite/DisabledCipherSuitesNotNegotiated.java 
line 187:

> 185:             };
> 186: 
> 187:             Boolean result = 
> executorService.invokeAny(List.of(serverThread,

invokeAny will return as soon as one task completes that means test would pass 
even if server fails after client success.

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

PR Review: https://git.openjdk.org/jdk/pull/30680#pullrequestreview-4248586103
PR Review Comment: https://git.openjdk.org/jdk/pull/30680#discussion_r3205519172
PR Review Comment: https://git.openjdk.org/jdk/pull/30680#discussion_r3205522192
PR Review Comment: https://git.openjdk.org/jdk/pull/30680#discussion_r3205506289
PR Review Comment: https://git.openjdk.org/jdk/pull/30680#discussion_r3205488944
PR Review Comment: https://git.openjdk.org/jdk/pull/30680#discussion_r3205490052
PR Review Comment: https://git.openjdk.org/jdk/pull/30680#discussion_r3205492631
PR Review Comment: https://git.openjdk.org/jdk/pull/30680#discussion_r3205496201
PR Review Comment: https://git.openjdk.org/jdk/pull/30680#discussion_r3205504940
PR Review Comment: https://git.openjdk.org/jdk/pull/30680#discussion_r3205549518

Reply via email to