Skip to content

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

Open
GoeLin wants to merge 4 commits intoopenjdk:masterfrom
GoeLin:goetz_backport_8373515
Open

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

Conversation

@GoeLin
Copy link
Copy Markdown
Member

@GoeLin GoeLin commented May 6, 2026

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)

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
Copy link
Copy Markdown

bridgekeeper Bot commented May 6, 2026

👋 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
Copy link
Copy Markdown

openjdk Bot commented May 6, 2026

❗ 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 3a80c639d804a0697b8eb477fe4c96407709449b 8373515: Migrate "test/jdk/java/net/httpclient/" to null-safe "SimpleSSLContext" methods May 6, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 6, 2026

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
Copy link
Copy Markdown

mlbridge Bot commented May 6, 2026

Webrevs

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

openjdk Bot commented May 8, 2026

@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
Copy link
Copy Markdown

openjdk Bot commented May 8, 2026

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

@GoeLin
Copy link
Copy Markdown
Member Author

GoeLin commented May 8, 2026

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

Copy link
Copy Markdown
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

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
Copy link
Copy Markdown

openjdk Bot commented May 8, 2026

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

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 rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants