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_r269526521
 
 

 ##########
 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) -> {
+                               TaskExecutorGateway tmGateway = 
taskManager.getSelfGateway(TaskExecutorGateway.class);
+                               try {
+                                       CompletableFuture<TransientBlobKey> 
logFuture =
+                                               
tmGateway.requestFileUpload(FileType.LOG, timeout);
+                                       logFuture.get();
+                               } catch (Exception e) {
+                                       assertTrue(e.getMessage().contains("The 
file LOG does not exist on the TaskExecutor."));
 
 Review comment:
   use hamcrest matchers instead `assertThat(e.getMessage(), 
containsString(...))`, gives a much better error message

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

Reply via email to