Skip to content

8373515: Migrate "test/jdk/java/net/httpclient/" to null-safe "SimpleSSLContext" methods#546

Closed
GoeLin wants to merge 4 commits into
openjdk:masterfrom
GoeLin:goetz_backport_8373515
Closed

8373515: Migrate "test/jdk/java/net/httpclient/" to null-safe "SimpleSSLContext" methods#546
GoeLin wants to merge 4 commits into
openjdk:masterfrom
GoeLin:goetz_backport_8373515

Conversation

@GoeLin

@GoeLin GoeLin commented May 6, 2026

Copy link
Copy Markdown
Member

I backport this for parity with 25.0.4-oracle.

The following files needed to be resolved, all trivial. Most are just pure context issues.
A few needed slight adaptions, these are pointed out below.
All tests were touched by "8349910: Implement JEP 517: HTTP/3 for the HTTP Client API",
where another change is missing in 25 I mention that explicitly.

https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/AbstractThrowingSubscribers.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/AsyncExecutorShutdown.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/BasicAuthTest.java
Resolved code looks slightly different.
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/CancelledResponse2.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/ContentLengthHeaderTest.java
https://bugs.openjdk.org/browse/JDK-8358942: HttpClient adds Content-Length: 0 for a GET request with a BodyPublishers.noBody()
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/EscapedOctetsInURI.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/ExecutorShutdown.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java
https://bugs.openjdk.org/browse/JDK-8367068: Remove redundant HttpRequest.BodyPublisher tests The change that makes this redundant is only in 26.
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/HeadTest.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/LineBodyHandlerTest.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/PathSubscriber/BodyHandlerOfFileDownloadTest.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/PathSubscriber/BodyHandlerOfFileTest.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/PathSubscriber/BodySubscriberOfFileTest.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/RedirectMethodChange.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/RedirectTimeoutTest.java
https://bugs.openjdk.org/browse/JDK-8368546: java/net/httpclient/RedirectTimeoutTest.java fails intermittently for HTTP/3 in tier7
Does not use SimpleSSLContext in 25 at all. Skipped.
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/ResponsePublisher.java
8260555: Change the default TIMEOUT_FACTOR from 4 to 1
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/RetryWithCookie.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/TlsContextTest.java
https://bugs.openjdk.org/browse/JDK-8371887: HttpClient: SSLParameters with no protocols configured disable HTTP2+ support
Resolved code looks slightly different.
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/UserAuthWithAuthenticator.java
Omitted editing test that was added for html3.
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/UserCookieTest.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/http2/ProxyTest2.java
Code differs.

A larger number of tests are not in 25.
Many were added by HTTP/3 changes, including new tests for the existing http implementations.
I omited these. The following missing tests seemed interesting to mention to me:

https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/AltServiceUsageTest.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/BasicHTTP2Test.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/BasicHTTP3Test.java
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/CancelledPartialResponseTest.java
These four files were cloned from test/jdk/java/net/httpclient/http2/ExpectContinueResetTest.java, but that
original file does not use SimpleSSLContext, so the change does not apply.
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/BufferSize1Test.java
Added by https://bugs.openjdk.org/browse/JDK-8367976: Validate and clamp jdk.httpclient.bufsize
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/DurationOverflowTest.java
Added by https://bugs.openjdk.org/browse/JDK-8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/FileChannelPublisherTest.java
Added by https://bugs.openjdk.org/browse/JDK-8329829: HttpClient: Add a BodyPublishers.ofFileChannel method
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/PlainConnectionLockTest.java
Added by https://bugs.openjdk.org/browse/JDK-8372198: Avoid closing PlainHttpConnection while holding a lock
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/TimeoutResponseTestSupport.java
Added by https://bugs.openjdk.org/browse/JDK-8208693: HttpClient: Extend the request timeout's scope to cover the response body
https://github.com/openjdk/jdk/commits/master/test/jdk/java/net/httpclient/http2/H2SelectorVTTest.java
Added by https://bugs.openjdk.org/browse/JDK-8372159: HttpClient SelectorManager thread could be a VirtualThread



Progress

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

Issue

  • JDK-8373515: Migrate "test/jdk/java/net/httpclient/" to null-safe "SimpleSSLContext" methods (Sub-task - P4 - Approved)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 546

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented May 6, 2026

Copy link
Copy Markdown

👋 Welcome back goetz! 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

openjdk Bot commented May 6, 2026

Copy link
Copy Markdown

@GoeLin This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8373515: Migrate "test/jdk/java/net/httpclient/" to null-safe "SimpleSSLContext" methods

Reviewed-by: mdoerr

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 20 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk Bot changed the title backport 3a80c639d804a0697b8eb477fe4c96407709449b 8373515: Migrate "test/jdk/java/net/httpclient/" to null-safe "SimpleSSLContext" methods May 6, 2026
@openjdk

openjdk Bot commented May 6, 2026

Copy link
Copy Markdown

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

@openjdk openjdk Bot added backport Port of a pull request already in a different code base rfr Pull request is ready for review labels May 6, 2026
@mlbridge

mlbridge Bot commented May 6, 2026

Copy link
Copy Markdown

Webrevs

@GoeLin GoeLin force-pushed the goetz_backport_8373515 branch from 0d82c2a to 06747d6 Compare May 8, 2026 08:27
@openjdk

openjdk Bot commented May 8, 2026

Copy link
Copy Markdown

@GoeLin Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@openjdk

openjdk Bot commented May 8, 2026

Copy link
Copy Markdown

⚠️ @GoeLin This backport pull request is too large to be automatically evaluated as clean.

@GoeLin

GoeLin commented May 8, 2026

Copy link
Copy Markdown
Member Author

The patches for RedirectTimeoutTest.java do not apply in 25. Thus the file should be untouched by this change. The original file lacked the newline at the end.
Somehow this newline sneaked into this change, but I failed to remove it ...

@TheRealMDoerr TheRealMDoerr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The resolution looks reasonable to me.

@openjdk

openjdk Bot commented May 8, 2026

Copy link
Copy Markdown

⚠️ @GoeLin 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.

@openjdk openjdk Bot added approval Requires approval; will be removed when approval is received ready Pull request is ready to be integrated and removed approval Requires approval; will be removed when approval is received labels May 10, 2026
@GoeLin

GoeLin commented May 11, 2026

Copy link
Copy Markdown
Member Author

/integrate

@openjdk

openjdk Bot commented May 11, 2026

Copy link
Copy Markdown

Going to push as commit 4de604a.
Since your change was applied there have been 21 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label May 11, 2026
@openjdk openjdk Bot closed this May 11, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 11, 2026
@openjdk

openjdk Bot commented May 11, 2026

Copy link
Copy Markdown

@GoeLin Pushed as commit 4de604a.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@GoeLin GoeLin deleted the goetz_backport_8373515 branch May 11, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants