MartijnVisser opened a new pull request, #27641:
URL: https://github.com/apache/flink/pull/27641
## What is the purpose of the change
The test connects to 192.0.2.1 (RFC 5737 TEST-NET-1) with a 1ms connection
timeout and asserts ConnectTimeoutException. On CI runners without a route to
this address, the OS immediately returns "Network is unreachable"
(AnnotatedSocketException) instead of timing out, causing the test to fail.
Both ConnectTimeoutException and AnnotatedSocketException are
SocketException subtypes, so the assertion now uses SocketException as the
expected cause type. The existing hasMessageContaining(unroutableIp) check
still verifies the failure is for the correct destination.
Note: on environments where the OS rejects immediately, the configured
connection timeout is never exercised. The test still verifies that connection
failures propagate correctly, but does not validate the timeout code path on
those environments. A more robust approach would require simulating a
non-completing TCP handshake, which is not portable.
## Brief change log
* Make `RestClientTest` accept `SocketException` errors
## Verifying this change
This change addresses and is covered by `RestClientTest`
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / **no**)
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: (yes / **no**)
- The serializers: (yes / **no** / don't know)
- The runtime per-record code paths (performance sensitive): (yes / **no**
/ don't know)
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / **no** / don't
know)
- The S3 file system connector: (yes / **no** / don't know)
## Documentation
- Does this pull request introduce a new feature? (yes / **no**)
- If yes, how is the feature documented? (**not applicable** / docs /
JavaDocs / not documented)
--
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]