Jiabao-Sun commented on code in PR #23976: URL: https://github.com/apache/flink/pull/23976#discussion_r1433817373
########## flink-streaming-java/src/test/java/org/apache/flink/streaming/api/operators/collect/CollectSinkFunctionTest.java: ########## @@ -136,9 +135,8 @@ void testConfiguredPortIsUsed() throws Exception { .getConfiguration() .setInteger(TaskManagerOptions.COLLECT_PORT, socket.getLocalPort()); assertThatThrownBy(() -> functionWrapper.openFunction()) - .satisfies( - FlinkAssertions.anyCauseMatches( - BindException.class, "Address already in use (Bind failed)")); + .isInstanceOf(BindException.class) + .hasMessageContaining("Address already in use"); Review Comment: Thanks @snuyanzin for the review. `FlinkAssertions.anyCauseMatches` will check all the causes, there will be additional overhead in abnormal conditions. In this case, just check the outer exception is enough. I think it is unnecessary to use the `anycauSematches`method. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org