StephanEwen commented on a change in pull request #14259:
URL: https://github.com/apache/flink/pull/14259#discussion_r532703903



##########
File path: 
flink-connectors/flink-connector-files/src/test/java/org/apache/flink/connector/file/src/FileSourceTextLinesITCase.java
##########
@@ -149,6 +280,49 @@ public void testContinuousTextFileSource() throws 
Exception {
                verifyResult(result1);
        }
 
+       // 
------------------------------------------------------------------------
+       //  test utilities
+       // 
------------------------------------------------------------------------
+
+       private enum FailoverType {
+               NONE,
+               TM,
+               JM
+       }
+
+       private static void triggerFailover(
+                       FailoverType type,
+                       JobID jobId,
+                       Runnable afterFailAction) throws Exception {
+               switch (type) {
+                       case NONE:
+                               afterFailAction.run();
+                               break;
+                       case TM:
+                               restartTaskManager(afterFailAction);
+                               break;
+                       case JM:
+                               triggerJobManagerFailover(jobId, 
afterFailAction);
+                               break;
+               }
+       }
+
+       private static void triggerJobManagerFailover(JobID jobId, Runnable 
afterFailAction) throws Exception {
+               highAvailabilityServices.revokeJobMasterLeadership(jobId).get();
+               Thread.sleep(50);

Review comment:
       @azagrebin Do you have any concerns about removing the sleeps here?




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to