@Test
  public void testParallelCompilationWithMultipleQuotasAndClientSessionConcurrency() throws Exception {
    conf.setBoolVar(HIVE_SERVER2_PARALLEL_COMPILATION, true);
    conf.setIntVar(HIVE_SERVER2_PARALLEL_COMPILATION_LIMIT, 2);

    initDriver(conf, 10);
    List<Integer> responseList = new ArrayList<>();

    List<Callable<List<Integer>>> callables = new ArrayList<>();
    for (int i = 0; i < 5; i++) {
      callables.add(() -> compileAndRespond(true, 2));
    }

    ExecutorService pool = Executors.newFixedThreadPool(callables.size());
    try {
      List<Future<List<Integer>>> futures = pool.invokeAll(callables);
      for (Future<List<Integer>> future : futures) {
        responseList.addAll(future.get());
      }
    } finally {
      pool.shutdown();
    }

    verifyThatWaitingCompileOpsCountIsEqualTo(0);
    verifyThatTimedOutCompileOpsCountIsZero(responseList);

    verifyThatConcurrentCompilationWasIndeed(responseList);
  }
Test that checks that the queries above the quota are timed out, so the compilation quota maximum is honored.
@throws Exception
ql/src/test/org/apache/hadoop/hive/ql/TestCompileLock.java