1996fanrui opened a new pull request, #29737:
URL: https://github.com/apache/flink/pull/29737

   ## What is the purpose of the change
   
   Backport of https://github.com/apache/flink/pull/28676 to release-1.20.
   
   `RestClientITCase#testHttpsConnectionWithDefaultCerts` only needs to prove 
that `RestClient` completes a TLS handshake, but it also required a JSON body, 
so a plain-text `429 Too Many Requests` from GitHub failed it after the 
handshake had already succeeded.
   
   ## Brief change log
   
     - Cherry-picked 435062c2c83 as 1770343aed8: on a failed request, assert 
that the failure chain contains a `RestClientException`.
     - Difference from the original: only the import conflict. This branch 
still uses JUnit 4, so `TestLogger` stays instead of `TestLoggerExtension`. The 
test logic is identical.
   
   ## Verifying this change
   
   This change is a test-only stabilization, verified with JDK 11:
   
   ```sh
   ./mvnw -pl flink-end-to-end-tests/flink-end-to-end-tests-restclient -am 
-Pskip-webui-build,run-end-to-end-tests -Dtest='RestClientITCase' 
-Dsurefire.failIfNoSpecifiedTests=false verify
   ./mvnw -q -pl flink-end-to-end-tests/flink-end-to-end-tests-restclient 
spotless:check checkstyle:check
   ```
   
   Results: `Tests run: 1, Failures: 0, Errors: 0, Skipped: 0`, and both style 
checks passed. The module's test only runs in the `integration-test` phase with 
`-Prun-end-to-end-tests`, hence `verify` and that profile.
   
   The test class was then run directly with JUnit, using the classpath from 
that build:
   
     - Unchanged test, 5 times: passed 5 of 5.
     - Temporarily pointed at a valid-TLS non-JSON body 
(`apache/flink/master/README.md`), the branch a 429 takes: passes with this 
change, and fails without it with `RestClientException: Response was not valid 
JSON`.
     - Temporarily pointed at `https://expired.badssl.com` (genuine certificate 
failure): fails with `expected an HTTP response proving the TLS handshake 
succeeded`.
   
   cc @MartijnVisser
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (Claude Opus 5.5)
   
   Generated-by: Claude Opus 5.5
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to