tillrohrmann commented on a change in pull request #7567: [FLINK-11358][tests]
Port LeaderChangeStateCleanupTest to new code base
URL: https://github.com/apache/flink/pull/7567#discussion_r251624205
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/DispatcherTest.java
##########
@@ -660,6 +661,32 @@ public void testFailingJobManagerRunnerCleanup() throws
Exception {
submissionFuture.get();
}
+ /**
+ * Tests that a submitted job is suspended if the Dispatcher loses
leadership.
+ */
+ @Test
+ public void testJobSuspensionWhenDispatcherLosesLeadership() throws
Exception {
+ dispatcher = createAndStartDispatcher(heartbeatServices,
haServices, new ExpectedJobIdJobManagerRunnerFactory(TEST_JOB_ID,
createdJobManagerRunnerLatch));
+
+
dispatcherLeaderElectionService.isLeader(UUID.randomUUID()).get();
+
+ DispatcherGateway dispatcherGateway =
dispatcher.getSelfGateway(DispatcherGateway.class);
+
+ dispatcherGateway.submitJob(jobGraph, TIMEOUT).get();
+
+ final CompletableFuture<JobResult> jobResultFuture =
dispatcherGateway.requestJobResult(jobGraph.getJobID(), TIMEOUT);
+
+ assertThat(jobResultFuture.isDone(), is(false));
+
+ dispatcherLeaderElectionService.notLeader();
+
+ try {
+ jobResultFuture.get();
Review comment:
yes definitely
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services