@Test
  @ExtendWith(LlapDaemonExtension.class)
  @ExtendWith(DoNothingTCPServerExtension.class)
  void testQueryRoutingLogFileNameOnIncompleteQuery(LlapDaemon daemon, DoNothingTCPServer amMockServer)
      throws IOException, InterruptedException {
    final int amPort = amMockServer.port();
    Credentials credentials = validSessionCredentials();
    String appId = "application_2500489363818_0021";
    String queryId = "query0";
    int dagId = 2000;
    daemon.registerDag(LlapDaemonTestUtils.buildRegisterDagRequest(appId, dagId, credentials));
    daemon.submitWork(LlapDaemonTestUtils.buildSubmitProtoRequest(appId, dagId, queryId, amPort, credentials));
    // Busy wait till all daemon tasks are treated 
    while (!daemon.getExecutorsStatus().isEmpty()) {
      Thread.sleep(100);
    }
    // The IdlePurgePolicy used should close appenders after 5 seconds of inactivity.
    // Wait for 8 sec to give some margin. 
    Thread.sleep(8000);
    assertFileExists("query0-dag_2500489363818_0021_2000.log");
  }
Tests for the log4j configuration of the LLAP daemons.
llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapDaemonLogging.java