Skip to content

Conversation

@sendaoYan
Copy link
Member

@sendaoYan sendaoYan commented Oct 22, 2025

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:

  • 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.
  • 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

  1. 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

  2. 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

  3. 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


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • JDK-8223145 needs maintainer approval
  • Commit message must refer to an issue

Issue

  • JDK-8223145: Replace wildcard address with loopback or local host in tests - part 1 (Sub-task - P3 - Requested)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/707/head:pull/707
$ git checkout pull/707

Update a local copy of the PR:
$ git checkout pull/707
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/707/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 707

View PR using the GUI difftool:
$ git pr show -t 707

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/707.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 22, 2025

👋 Welcome back syan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 22, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title Backport 7d4520c109f408a7dbcdcc424dfef121e3eeaaa7 8223145: Replace wildcard address with loopback or local host in tests - part 1 Oct 22, 2025
@openjdk
Copy link

openjdk bot commented Oct 22, 2025

This backport pull request has now been updated with issue and summary from the original commit.

@openjdk openjdk bot added the backport Port of a pull request already in a different code base label Oct 22, 2025
@sendaoYan sendaoYan marked this pull request as ready for review October 22, 2025 09:15
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 22, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 22, 2025

Webrevs

@sendaoYan
Copy link
Member Author

GHA report linux-x86 gc/concurrentMarkSweep/SystemGCOnForegroundCollector.java trigger jvm crash, which has been recorded by JDK-8361833. I think it's unrelated to this backport PR.

dfuch and others added 2 commits October 22, 2025 16:30
…ace 'import jdk.test.lib.net.URIBuilder;' as 'import jdk.testlibrary.net.URIBuilder;'
Copy link
Member

@phohensee phohensee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@openjdk
Copy link

openjdk bot commented Oct 27, 2025

⚠️ @sendaoYan This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@sendaoYan
Copy link
Member Author

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.

Thanks for your patient reviews.

I get the patch file of JDK-8223145 in main-line repo(git show 7d4520c109f408a7dbcdcc424dfef121e3eeaaa7) and the patch file for this PR, and then compare these two patch files. The added lines and removed lines are all the same for TestHttpServer.java file. So I think it do not have extra change for TestHttpServer.java.

@sendaoYan
Copy link
Member Author

GHA report test gc/concurrentMarkSweep/SystemGCOnForegroundCollector.java fails on linux-x86, jvm crash at 'CompactibleFreeListSpace::block_size(HeapWord const*)'. This issue has been recorded by JDK-8361833. It's unrelated to this backport PR.

/approval request Backport to fix the test bug. which may cause test imtermittent on some machines. Change has been verified both by locally and by full jtreg jenkins tests. Test-fix only, risk is low.

@openjdk
Copy link

openjdk bot commented Oct 28, 2025

@sendaoYan
8223145: The approval request has been created successfully.

@openjdk openjdk bot added the approval Requires approval; will be removed when approval is received label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval Requires approval; will be removed when approval is received backport Port of a pull request already in a different code base rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants