The GitHub Actions job "npm_and_yarn in /flink-runtime-web/web-dashboard for 
minimatch - Update #1262573496" on flink.git/master has failed.
Run started by GitHub user dependabot[bot] (triggered by dependabot[bot]).

Head commit for run:
9f20f1d0e5cdf3168b294284114ea9ace06576a4 / Martijn Visser 
<[email protected]>
[FLINK-39180][tests] Fix flaky RestClientTest.testRestClientClosedHandling

The test was failing in CI with the following error:

  RestClientTest.testRestClientClosedHandling:249
  Expecting a throwable with cause being an instance of:
    java.io.IOException
  but was an instance of:
    java.lang.IllegalStateException

Root cause: FLINK-32583 changed RestClient behavior to throw
IllegalStateException when closed to prevent deadlocks, but the
test was never updated from its original IOException expectation.

The test now accepts both IllegalStateException and IOException
since a race condition exists:
- IllegalStateException with message "RestClient closed before
  request completed": Thrown by
  RestClient#notifyResponseFuturesOfShutdown() when close() is
  called before connection establishes
- ConnectionClosedException (extends IOException): Thrown by
  RestClient.ClientHandler#channelInactive() when connection is
  established but becomes inactive due to client closure

Both are valid outcomes when closing the client with a request
in-flight. The race is confirmed by test behavior:
- Run alone: Gets IllegalStateException consistently
- Run with other tests: Gets ConnectionClosedException

Added message verification for IllegalStateException to ensure
we catch the expected exception from
notifyResponseFuturesOfShutdown()

Report URL: https://github.com/apache/flink/actions/runs/22539880049

With regards,
GitHub Actions via GitBox

Reply via email to