On Wed, 3 Mar 2021 12:23:00 GMT, Fernando Guallini <fguall...@openjdk.org> wrote:
> Certain JVM tools may access and initialise InetAddress class and its static > fields during start up resulting in a NameService implementation being > already set to the default **PlatformNameService**, causing intermittent > failures in some tests that expect the use of **HostsFileNameService** > instead by setting the system property jdk.net.hosts.file in the test main > body, which has no effect in this scenario > > By setting the property **jdk.net.hosts.file** in the @run tag, there is > certainty that it will be properly configured at the time that a > [NameService](https://github.com/openjdk/jdk/blob/382e38dd246596ec94a1f1ce0e0f9e87f53366c7/src/java.base/share/classes/java/net/InetAddress.java#L1155) > is created This pull request has now been integrated. Changeset: e1cad970 Author: Fernando Guallini <fguall...@openjdk.org> Committer: Aleksei Efimov <aefi...@openjdk.org> URL: https://git.openjdk.java.net/jdk/commit/e1cad970 Stats: 32 lines in 2 files changed: 7 ins; 20 del; 5 mod 8262862: Harden tests sun/security/x509/URICertStore/ExtensionsWithLDAP.java and krb5/canonicalize/Test.java Reviewed-by: aefimov, michaelm ------------- PR: https://git.openjdk.java.net/jdk/pull/2809