[jdk8u-dev] RFR: 8223145: Replace wildcard address with loopback or local host in tests - part 1
SendaoYan
syan at openjdk.org
Wed Oct 22 11:42:48 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
GHA report [linux-x86](https://github.com/sendaoYan/jdk8u-dev-ysd/actions/runs/18711380008/job/53361647054) gc/concurrentMarkSweep/SystemGCOnForegroundCollector.java trigger jvm crash, which has been recorded by [JDK-8361833](https://bugs.openjdk.org/browse/JDK-8361833). I think it's unrelated to this backport PR.
-------------
PR Comment: https://git.openjdk.org/jdk8u-dev/pull/707#issuecomment-3431947638
More information about the jdk8u-dev
mailing list