public void clearTestSideEffects() throws Exception {
    if (System.getenv(QTEST_LEAVE_FILES) != null) {
      return;
    }
    // the test might have configured security/etc; open a new session to get rid of that
    newSession();

    // Remove any cached results from the previous test.
    Utilities.clearWorkMap(conf);
    NotificationEventPoll.shutdown();
    QueryResultsCache.cleanupInstance();
    clearTablesCreatedDuringTests();
    clearUDFsCreatedDuringTests();
    clearKeysCreatedInTests();
    StatsSources.clearGlobalStats();
    dispatcher.afterTest(this);
  }
Clear out any side effects of running tests
itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java