MartijnVisser opened a new pull request, #27713:
URL: https://github.com/apache/flink/pull/27713
## What is the purpose of the change
This PR fixes a flaky test `RestClientTest.testRestClientClosedHandling`
that was failing in CI with `IllegalStateException` but expecting `IOException`.
CI failure:
```
RestClientTest.testRestClientClosedHandling:249
Expecting a throwable with cause being an instance of:
java.io.IOException
but was an instance of:
java.lang.IllegalStateException
```
## Brief change log
- Updated `testRestClientClosedHandling` to accept both
`IllegalStateException` and `IOException` as valid exceptions
- Added message verification for `IllegalStateException` to ensure we catch
the expected "RestClient closed before request completed" message
## Verifying this change
This change fixes a flaky test and is covered by existing tests.
**Testing performed:**
- Ran `testRestClientClosedHandling` alone: passes (gets
IllegalStateException)
- Ran `testRestClientClosedHandling` with all RestClientTest tests: passes
(sometimes gets ConnectionClosedException)
- All 9 tests in RestClientTest pass consistently
**Root cause analysis:**
- FLINK-32583 added `RestClient#notifyResponseFuturesOfShutdown()` throwing
IllegalStateException when client is closed
- `RestClient.ClientHandler#channelInactive()` throws
ConnectionClosedException when channel becomes inactive
- Race condition exists: depends on whether connection establishes before
close() completes
- Test was never updated after FLINK-32583 changed the behavior
## 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
--
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]