Github user tzulitai commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5172#discussion_r165663546
  
    --- Diff: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnTaskManagerRunner.java ---
    @@ -142,19 +153,10 @@ public static void runYarnTaskManager(String[] args, 
final Class<? extends YarnT
     
                        SecurityUtils.install(sc);
     
    -                   SecurityUtils.getInstalledContext().runSecured(new 
Callable<Object>() {
    -                           @Override
    -                           public Integer call() {
    -                                   try {
    -                                           
TaskManager.selectNetworkInterfaceAndRunTaskManager(configuration, resourceId, 
taskManager);
    -                                   }
    -                                   catch (Throwable t) {
    -                                           LOG.error("Error while starting 
the TaskManager", t);
    -                                           
System.exit(TaskManager.STARTUP_FAILURE_RETURN_CODE());
    -                                   }
    -                                   return null;
    -                           }
    -                   });
    +                   if (mainRunner == null) {
    --- End diff --
    
    I don't think this is a good idea, to add a code path in production code 
that exists only for the purpose of injecting a mock runner dependency in tests.
    
    I've added another commit upon @suez1224's changes that makes 
`YarnTaskManagerRunner` a factory-like class, that creates a `Runner` 
containing all the final configurations. The unit test can then test against 
that configuration.


---

Reply via email to