GJL commented on a change in pull request #7676: [FLINK-11364][tests] Port
TaskManagerFailsITCase to new code base
URL: https://github.com/apache/flink/pull/7676#discussion_r256289305
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java
##########
@@ -1430,6 +1422,125 @@ public void
testReleasingTaskExecutorIfNoMoreSlotsRegistered() throws Exception
}
}
+ @Nonnull
+ private TestingResourceManagerGateway
createAndRegisterTestingResourceManagerGateway() {
+ final TestingResourceManagerGateway
testingResourceManagerGateway = new TestingResourceManagerGateway();
+
rpcService.registerGateway(testingResourceManagerGateway.getAddress(),
testingResourceManagerGateway);
+ return testingResourceManagerGateway;
+ }
+
+ /**
+ * Tests that the job execution is failed if the TaskExecutor
disconnects from the
+ * JobMaster.
+ */
+ @Test
+ public void testJobFailureWhenGracefulTaskExecutorTermination() throws
Exception {
+ runJobFailureWhenTaskExecutorTerminatesTest(
+ () -> heartbeatServices,
+ (localTaskManagerLocation, jobMasterGateway) ->
jobMasterGateway.disconnectTaskManager(
+ localTaskManagerLocation.getResourceID(),
+ new FlinkException("Test disconnectTaskManager
exception.")),
+ (jobMasterGateway, resourceID) -> ignored -> {});
+ }
+
+ @Test
+ public void testJobFailureWhenTaskExecutorHeartbeatTimeout() throws
Exception {
+ final AtomicBoolean respondToHeartbeats = new
AtomicBoolean(true);
+ runJobFailureWhenTaskExecutorTerminatesTest(
+ () -> fastHeartbeatServices,
Review comment:
```suggestion
fastHeartbeatServices,
```
----------------------------------------------------------------
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