XComp commented on code in PR #22380:
URL: https://github.com/apache/flink/pull/22380#discussion_r1193867705


##########
flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/TestingLeaderBase.java:
##########
@@ -80,6 +84,20 @@ public Throwable getError() {
         return error == null ? errorQueue.poll() : error;
     }
 
+    /**
+     * Method for exposing errors that were caught during the test execution 
and need to be exposed
+     * within the test.
+     */
+    public void throwErrorIfPresent() throws Throwable {
+        if (error != null) {
+            throw error;
+        }
+
+        if (!errorQueue.isEmpty()) {
+            throw errorQueue.poll();
+        }
+    }

Review Comment:
   fair point. That reduces the diff for `DefaultLeaderElectionServiceTest`. 
:+1: I wrapped it into an `AssertionError` now.



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

Reply via email to