mateczagany commented on code in PR #27669:
URL: https://github.com/apache/flink/pull/27669#discussion_r2868458682


##########
flink-tests/src/test/java/org/apache/flink/test/accumulators/AccumulatorErrorITCase.java:
##########
@@ -197,11 +193,8 @@ private static class CustomException extends 
RuntimeException {
     }
 
     private static void assertAccumulatorsShouldFail(JobExecutionResult 
result) {
-        try {
-            result.getAllAccumulatorResults();
-            fail("Should have failed");
-        } catch (Exception ex) {
-            assertTrue(findThrowable(ex, CustomException.class).isPresent());
-        }
+        assertThatThrownBy(result::getAllAccumulatorResults)
+                .cause()
+                .hasCauseInstanceOf(CustomException.class);

Review Comment:
   I've added that here, as there are 2 instances this can be thrown in this 
class. I've tried to keep changes of test logic minimal to keep the update and 
review process simpler. 



-- 
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]

Reply via email to