@Test
  public void testDeadline() throws Exception {
    isFailed = false;
    errorMsg = "";

    Thread threadTimeout = new Thread(createRunnable());
    threadTimeout.setDaemon(true);
    threadTimeout.start();
    threadTimeout.join(60000);

    if (isFailed) {
      Assert.fail(errorMsg);
    }
  }
Test the Deadline class used for long running requests.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestDeadline.java