RFR [9] 8158525: Update a few java/net tests to use the loopback address instead of the host address
Chris Hegarty
chris.hegarty at oracle.com
Thu Jun 2 19:12:16 UTC 2016
On 2 Jun 2016, at 14:37, Roger Riggs <Roger.Riggs at oracle.com> wrote:
>
> Hi Chris,
>
> looks fine but a couple of questions/suggestions.
Thanks for looking at this Roger.
> CookieManagerTest.java:
>
> - the new definition of localHostAddr could probably be moved to a class static and be used instead of the "127.0.0.1" literal (line 97).
Agreed. In fact we can do better; where possible the host IP will be used.
The test requires an IP literal, for cookie domain matching. Otherwise, the
static test string values will all need to be updated.
> - Does the use of the IPV4 loopback address work even in the case of supporting only IPV6?
> I'm not sure this is relevant to recent changes to support IPV6 only.
Probably not, but while we are moving towards support for IPv6-only
environments at runtime, our tests will require a lot of work if they
are to be able to be run successfully in such an environment.
> UnmodifiableMaps and HandleContentTypeWithAttrs:
>
> - I assume that the lookup of localhost doesn't trigger the potential timeouts to be avoided.
> (Or 127.0.0.1 would have been used here too).
It works fine all systems I’ve tested with.
Update in-palce:
http://cr.openjdk.java.net/~chegar/8158525/
-Chris.
> Roger
>
>
>
> On 6/2/2016 9:22 AM, Chris Hegarty wrote:
>> The following networking tests have been seen to fail from a timeout, when the host
>> is not accessible. These tests have nothing whatsoever to do with testing of network
>> connections, they simply want to test the HTTP client implementation. This issue
>> proposes to change the tests from using the host's name/address to using the
>> loopback, to make them more robust.
>>
>> test/java/net/CookieHandler/CookieManagerTest.java
>> test/java/net/HttpURLConnection/UnmodifiableMaps.java
>> test/java/net/URLConnection/HandleContentTypeWithAttrs.java
>>
>> http://cr.openjdk.java.net/~chegar/8158525/
>> https://bugs.openjdk.java.net/browse/JDK-8158525
>>
>> -Chris.
>
More information about the net-dev
mailing list