zentol commented on a change in pull request #7780: [FLINK-11593][tests] Check
& port TaskManagerTest to new code base
URL: https://github.com/apache/flink/pull/7780#discussion_r269527560
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorTest.java
##########
@@ -1753,16 +1396,59 @@ public void testDisconnectFromJobMasterWhenNewLeader()
throws Exception {
}
}
- private TaskExecutorLocalStateStoresManager
createTaskExecutorLocalStateStoresManager() throws IOException {
- return new TaskExecutorLocalStateStoresManager(
- false,
- new File[]{tmp.newFolder()},
- Executors.directExecutor());
+ @Test(timeout = 10000L)
+ public void testLogNotFoundHandling() throws Throwable {
+ final JobMasterId jobMasterId = JobMasterId.generate();
+
+ final int dataPort = NetUtils.getAvailablePort();
+ Configuration config = new Configuration();
+ config.setInteger(TaskManagerOptions.DATA_PORT, dataPort);
+
config.setInteger(TaskManagerOptions.NETWORK_REQUEST_BACKOFF_INITIAL, 100);
+
config.setInteger(TaskManagerOptions.NETWORK_REQUEST_BACKOFF_MAX, 200);
+ config.setString(ConfigConstants.TASK_MANAGER_LOG_PATH_KEY,
"/i/dont/exist");
+
+ prepareTaskSubmissionTestEnvironmentBuilder()
+ .setJobMasterId(jobMasterId)
+ .setConfiguration(config)
+ .setLocalCommunication(false)
+ .setTest((taskManager, taskManagerConfiguration) -> {
Review comment:
this approach is quite unflexible. If we ever want to expose more arguments
to the test it's quite a bit of work to do so.
Instead I'd recommend the following pattern:
```
try (TaskSubmissionTestEnvironment environment = <builder pattern>) {
TaskExecutorGateway tmGateway =
environment.getTaskManager().getSelfGateway(TaskExecutorGateway.class);
<remaining test code>
}
```
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services