RFR: 8350546: Several java/net/InetAddress tests fails UnknownHostException [v4]

Jaikiran Pai jpai at openjdk.org
Mon Mar 3 12:51:53 UTC 2025


On Mon, 3 Mar 2025 11:18:10 GMT, SendaoYan <syan at openjdk.org> wrote:

>> Hi all,
>> 
>> Two java/net/InetAddress tests fails "java.net.UnknownHostException" on some special machines. The machine cannot connect to the Internet directly and needs to be connected to the Internet through a jump machine. The java/net/InetAddress tests report "java.net.UnknownHostException: bugs.openjdk.org: Temporary failure in name resolution" failure do not caused by JVM bug but environmentalk issue, so this PR match the java.net.UnknownHostException and throw jtreg.SkippedException instead of report test fails.
>> 
>> And run the tests with JVM options `-Dhttp.proxyHost=192.168.50.1 -Dhttp.proxyPort=10991 -Dhttps.proxyHost=192.168.50.1 -Dhttps.proxyPort=10991 -DsocksProxyHost=192.168.50.1 -DsocksProxyPort=10991` can not work around. So I create this PR to fix the test bug.
>> 
>> Command wget shows that the machine should connect to internet through a jumper machine(192.168.50.1:10991):
>> 
>>> wget www.bing.com
>> --2025-02-24 17:56:25--  http://www.bing.com/
>> Connecting to 192.168.50.1:10991... connected.
>> Proxy request sent, awaiting response... 301 Moved Permanently
>> Location: http://cn.bing.com/ [following]
>> --2025-02-24 17:56:25--  http://cn.bing.com/
>> Reusing existing connection to 192.168.50.1:10991.
>> Proxy request sent, awaiting response... 200 OK
>> Length: 13006 (13K) [text/html]
>> Saving to: ‘index.html’
>> 
>> 
>> Change has been verified locally, test-fix only and make tests more robustness, no risk.
>
> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove "@build jtreg.SkippedException"

test/jdk/java/net/InetAddress/IsReachableViaLoopbackTest.java line 63:

> 61:         } catch (java.net.UnknownHostException e) {
> 62:             e.printStackTrace();
> 63:             throw new SkippedException("Network setup issue");

I am wondering for tests like these two whether we should introduce a JDK specific `@key` (in `TEST.ROOT`) https://openjdk.org/jtreg/tag-spec.html and then have these 2 tests use that key to indicate that these tests require an external connection. That way, when launching jtreg you can specify that it skip executing these tests based on that key name.

Daniel, Aleksei, would there be some other better way to deal with this?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23767#discussion_r1977468146


More information about the net-dev mailing list