[jdk8u-dev] RFR: 8223145: Replace wildcard address with loopback or local host in tests - part 1
Paul Hohensee
phh at openjdk.org
Mon Oct 27 19:10:15 UTC 2025
On Wed, 22 Oct 2025 08:37:45 GMT, SendaoYan <syan at openjdk.org> wrote:
> Hi, all
>
> We observed the test java/net/Socket/GetLocalAddress.java intermittently fails "java.net.SocketException: Invalid argument or cannot assign requested address" very often. So I want to backport JDK-8223145 to jdk8u-dev to fix this issue.
>
> Testing:
>
> - [x] Test all the touch files locally on linux-x64, except sun/net/www/httptest/TestHttpServer.java and lib/testlibrary/jdk/testlibrary/net/URIBuilder.java which use as test library.
> - [x] Test all the jtreg tests by jenkins.
>
> There are 3 types of files cause backport uncleanly.
>
> 1. Different context cause should replace '127.0.0.1' as 'loopback' manually.
>
> jdk/test/com/sun/net/httpserver/bugs/B6361557.java
> jdk/test/java/net/Socket/UrgentDataTest.java
> jdk/test/sun/net/www/http/HttpURLConnection/PostOnDelete.java
>
> 2. Different context cause deal with copyright year manually.
> jdk/test/java/net/Socket/TestAfterClose.java
> jdk/test/java/net/ResponseCache/ResponseCacheTest.java
> jdk/test/sun/net/www/protocol/http/B8012625.java
>
>
> 3. Test was added after jdk8+, so it's not needed deal with jdk8u-dev
> java/net/SocketOption/OptionsTest.java
> java/net/URLPermission/nstest/LookupTest.java
> sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java
>
> 4. The test library located difference, so we need to adopt in jdk8u-dev: replace '@library /test/lib' as '@library /lib/testlibrary', and replace 'import jdk.test.lib.net.URIBuilder;' as 'import jdk.testlibrary.net.URIBuilder;'.
> java/net/ResponseCache/ResponseCacheTest.java
> java/net/HttpURLConnection/UnmodifiableMaps.java
> sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java
> sun/net/www/http/KeepAliveStream/KeepAliveStreamClose.java
> java/net/URL/GetContent.java
Looks like you grabbed changes to TestHttpServer.java from somewhere, but git blame doesn't help me find from which JBS issue(s). If you know, and it makes sense to backport it/those, please add any such issues. Otherwise, lgtm as is.
-------------
Marked as reviewed by phh (Reviewer).
PR Review: https://git.openjdk.org/jdk8u-dev/pull/707#pullrequestreview-3385053000
More information about the jdk8u-dev
mailing list