[jdk25u-dev] RFR: 8373807: test/jdk/java/net/httpclient/websocket/DummyWebSocketServer.java getURI() uses "localhost"

Roland Mesde duke at openjdk.org
Tue Jan 27 18:00:19 UTC 2026


Backporting JDK-8373807: test/jdk/java/net/httpclient/websocket/DummyWebSocketServer.java getURI() uses "localhost".

The WebSocketTest experienced an intermittent timeout failure where WebSocketBuilder::build's CompletableFuture never completed. 

Root Cause (suspected): Request misdirection due to using "localhost" in the URI, which can resolve to either IPv4 (127.0.0.1) or IPv6 (::1) depending on system configuration.

Fix: Change DummyWebSocketServer::getURI to return a URI with a literal IP address instead of "localhost" to ensure consistent address resolution and prevent misdirection.

For parity with Oracle JDK.

Ran related tests on linux-x64, linux-aarch64, macos-aarch64 and windows-x64:

make test TEST=test/jdk/java/net/httpclient/websocket

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

Commit messages:
 - Backport f3a48560b5e3a280f6f76031eb3d475ff9ee49f4

Changes: https://git.openjdk.org/jdk25u-dev/pull/189/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk25u-dev&pr=189&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8373807
  Stats: 8 lines in 1 file changed: 7 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk25u-dev/pull/189.diff
  Fetch: git fetch https://git.openjdk.org/jdk25u-dev.git pull/189/head:pull/189

PR: https://git.openjdk.org/jdk25u-dev/pull/189


More information about the jdk-updates-dev mailing list