private void cleanupFromFile() throws IOException {
    File cleanupFile = new File(cleanupScript);
    if (cleanupFile.isFile()) {
      String cleanupCommands = FileUtils.readFileToString(cleanupFile, StandardCharsets.UTF_8);
      LOG.info("Cleanup (" + cleanupScript + "):\n" + cleanupCommands);

      try {
        getCliDriver().processLine(cleanupCommands);
      } catch (CommandProcessorException e) {
        LOG.error("Failed during cleanup processLine with code={}. Ignoring", e.getResponseCode());
        // TODO Convert this to an Assert.fail once HIVE-14682 is fixed
      }
    } else {
      LOG.info("No cleanup script detected. Skipping.");
    }
  }
Clear out any side effects of running tests
itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java