RFR: 8291652: (ch) java/nio/channels/SocketChannel/VectorIO.java failed with "Exception: Server 15: Timed out"
Jaikiran Pai
jpai at openjdk.org
Mon Jun 30 16:01:49 UTC 2025
Can I please get a review of this test-only change which proposes to address an intermittent test failure in `java/nio/channels/SocketChannel/VectorIO.java`?
As noted in https://bugs.openjdk.org/browse/JDK-8291652, this test has been failing intermittently in our CI. Some years back the test was improved to include additional debug logs to identify the root cause https://bugs.openjdk.org/browse/JDK-8180085. In a recent failure, these test logs indicate that the `Server` thread hadn't yet `accept()`ed a Socket connection, when the client side of the test threw an exception because it had waited for 8 seconds for the server side of the test to complete.
The change in this PR updates the test to wait for the `Server` thread to reach a point where it is ready to `accept()` a Socket connection. Only after it reaches this state, the client side of the testing will be initiated. Furthermore, the artificial 8 second wait has been removed from this test and it now waits as long as it takes for the testing to complete. If the test waits far too long then the jtreg infrastructure will timeout the test and at the same time capture the necessary artifacts to help debug unexpected time outs.
While at it, the test has also been updated to use `InetAddress.getLoopbackAddress()` instead of localhost. This should prevent any unexpected address mappings for localhost from playing a role in this test.
With these changes, I've run the test more than 1000 times in our CI and it hasn't failed.
-------------
Commit messages:
- use loopback address in test
- 8291652: (ch) java/nio/channels/SocketChannel/VectorIO.java failed with "Exception: Server 15: Timed out"
Changes: https://git.openjdk.org/jdk/pull/26049/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26049&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8291652
Stats: 50 lines in 2 files changed: 40 ins; 0 del; 10 mod
Patch: https://git.openjdk.org/jdk/pull/26049.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/26049/head:pull/26049
PR: https://git.openjdk.org/jdk/pull/26049
More information about the nio-dev
mailing list