Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/2974#discussion_r97346693 --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerTest.java --- @@ -1074,6 +1080,79 @@ protected void run() { }}; } + @Test + public void testLogNotFoundHandling() throws Exception { + + new JavaTestKit(system){{ + + ActorGateway jobManager = null; + ActorGateway taskManager = null; + + final ActorGateway testActorGateway = new AkkaActorGateway( + getTestActor(), + leaderSessionID); + + try { + final IntermediateDataSetID resultId = new IntermediateDataSetID(); + + // Create the JM + ActorRef jm = system.actorOf(Props.create( + new SimplePartitionStateLookupJobManagerCreator(leaderSessionID, getTestActor()))); + + jobManager = new AkkaActorGateway(jm, leaderSessionID); + + final int dataPort = NetUtils.getAvailablePort(); + Configuration config = new Configuration(); + config.setInteger(ConfigConstants.TASK_MANAGER_DATA_PORT_KEY, 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"); + + taskManager = TestingUtils.createTaskManager( + system, + jobManager, + config, + false, + true); + + // --------------------------------------------------------------------------------- + + final ActorGateway tm = taskManager; + final ExecutionContextExecutor context = ExecutionContext$.MODULE$.fromExecutor(Executors.newSingleThreadExecutor()); + + new Within(d) { + @Override + protected void run() { + Future<Object> logFuture = tm.ask(TaskManagerMessages.getRequestTaskManagerLog(), timeout); + + logFuture.onSuccess(new OnSuccess<Object>() { + @Override + public void onSuccess(Object result) throws Throwable { + Assert.fail(); + } + }, context); + logFuture.onFailure(new OnFailure() { + @Override + public void onFailure(Throwable failure) throws Throwable { + testActorGateway.tell(new Status.Success("success")); + } + }, context); --- End diff -- Maybe `Await.result` is a bit more succinct.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---