[ 
https://issues.apache.org/jira/browse/FLINK-39180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18061820#comment-18061820
 ] 

Martijn Visser commented on FLINK-39180:
----------------------------------------

RestClientTest.testRestClientClosedHandling is flaky because the exception type 
thrown when the RestClient is closed with a request in-flight depends on a race 
condition.

The exact exception depends on timing:

- If the RestClient is closed before the connection is established, 
RestClient#notifyResponseFuturesOfShutdown() throws IllegalStateException 
(added in FLINK-32583).
- If the connection is established first and then becomes inactive due to 
client closure, RestClient.ClientHandler#channelInactive(ChannelHandlerContext) 
throws ConnectionClosedException (which extends IOException).

Both are valid outcomes when the client is closed with a request in-flight. The 
test previously only expected IOException, which fails when the 
IllegalStateException path wins the race.

> RestClientTest.testRestClientClosedHandling fails with wrong assertion
> ----------------------------------------------------------------------
>
>                 Key: FLINK-39180
>                 URL: https://issues.apache.org/jira/browse/FLINK-39180
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / REST
>            Reporter: Martijn Visser
>            Priority: Major
>
> {code:java}
> Feb 28 01:58:12 01:58:12.685 [ERROR] Failures: 
> Feb 28 01:58:12 01:58:12.685 [ERROR]   
> RestClientTest.testRestClientClosedHandling:249 
> Feb 28 01:58:12 Expecting a throwable with cause being an instance of:
> Feb 28 01:58:12   java.io.IOException
> Feb 28 01:58:12 but was an instance of:
> Feb 28 01:58:12   java.lang.IllegalStateException
> Feb 28 01:58:12 Throwable that failed the check:
> {code}
> https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=72795&view=logs&j=f0ac5c25-1168-55a5-07ff-0e88223afed9&t=e65258a6-40a1-5a09-c394-f70d913b73cd&l=80656



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to