private void resetParallelCompilationLimit(HiveConf conf) throws Exception {
    Enum<?> compileLock = createEnumInstance("instance", Class.forName("org.apache.hadoop.hive.ql.lock" +
        ".CompileLockFactory$SessionWithQuotaCompileLock"));

    Field field = compileLock.getClass().getDeclaredField("globalCompileQuotas");
    field.setAccessible(true);

    int compileLimit = conf.getIntVar(HIVE_SERVER2_PARALLEL_COMPILATION_LIMIT);
    field.set(compileLock, new Semaphore(compileLimit));
  }
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