@Test
  public void testSerializableCompilation() throws Exception {
    conf.setBoolVar(HIVE_SERVER2_PARALLEL_COMPILATION, false);

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

    verifyThatWaitingCompileOpsCountIsEqualTo(0);
    verifyThatTimedOutCompileOpsCountIsZero(responseList);

    verifyThatNoConcurrentCompilationWasIndeed(responseList);
  }
Class for testing HS2 compile lock behavior (serializable, parallel unbounded, parallel bounded).
ql/src/test/org/apache/hadoop/hive/ql/TestCompileLock.java