Intermittent failures have been observed across java.net that are related to use of System.setproperty("jdk.net.hosts.file") to configure the use of the HostsFileNameService. This is causing issues as it is possible for certain JVM tools to access InetAddress and initialise it's static members (such as nameService and impl) during start-up resulting in a Name Service configuration being already set to the default PlatformNameService by the the time a test run is commenced.
These intermittent failures can be resolved by setting the relevant system property (jdk.net.hosts.file) in the run tag of the jtreg test arguments. This provides certainty that the correct system properties will be set by the time the test is run.
The following tests are concerned with this issue:
java/net/Inet4Address/textToNumericFormat.java
java/net/InetAddress/InternalNameServiceWithNoHostsFileTest.java
java/net/InetAddress/InternalNameServiceWithHostsFileTest.java
java/net/InetAddress/InternalNameServiceTest.java
java/net/URLPermission/nstest/LookupTest.java
sun/net/InetAddress/nameservice/simple/DefaultCaching.java
sun/net/InetAddress/nameservice/simple/CacheTest.java