On Thu, 8 Jun 2023 14:25:20 GMT, Mark Sheppard <[email protected]> wrote:
>> Darragh Clarke has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> implemented feedback
>
> test/jdk/java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java
> line 428:
>
>> 426: URL url = URIBuilder.newBuilder()
>> 427: .scheme("http")
>> 428: .host(InetAddress.getLoopbackAddress())
>
> This will change the call flow of the test in a slightly subtle way. In the
> original the "host" is supplied i.e. localhost which should map to the
> loopback address, and in the change the loopback IP address is being supplied
> diectly. In terms of equivalence then supplying a host string might be more
> appropriate:
> .host("localhost")
No that's precisely what we want to avoid. Because how "localhost" maps to an
InetAddress depends on the machine configuration, which is a recipe for
intermittent failures.
I'd suggest:
URL url = URIBuilder.newBuilder()
.scheme("http")
.localhost()
(which is actually the same)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14177#discussion_r1223187935