On Wed, 1 Jul 2026 19:52:05 GMT, Ashay Rane <[email protected]> wrote:
> Prior to this patch, the test failed if the hostname returned by > `startListening()` didn't match either the string "localhost" or the IP > addresses associated with "localhost", but this is fragile. On machines > where a reverse lookup on 127.0.0.1 returns a string other than > localhost, the test fails, like in the following example: > > >>_ jdb -connect com.sun.jdi.SocketListen:port=50000 > Listening at address: kubernetes.docker.internal:50000 > ... > >>_ make test TEST=.../startlis001/TestDescription.java > ... > Test case #1: start listening the address kubernetes.docker.internal:49532 > Expected addresses: localhost:null or 127.0.0.1:null or 0:0:0:0:0:0:0:1:null > ... > > > As a workaround, this patch uses `InetAddress.isLoopbackAddress()` on > the hostname portion of the address that is being listened. > > Validated this patch on machines where the reverse lookup resolves to > either "localhost" or a different string. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). Merged master branch to pull an unrelated change that problem lists and failing test. ------------- PR Comment: https://git.openjdk.org/jdk/pull/31744#issuecomment-4860625899
