public void newSession(boolean canReuseSession) throws Exception {
    // allocate and initialize a new conf since a test can
    // modify conf by using 'set' commands
    conf = new HiveConf(savedConf);
    initConf();
    initConfFromSetup();

    // renew the metastore since the cluster type is unencrypted
    db = Hive.get(conf); // propagate new conf to meta store

    HiveConf.setVar(conf,
        HiveConf.ConfVars.HIVE_AUTHENTICATOR_MANAGER,
        "org.apache.hadoop.hive.ql.security.DummyAuthenticator");
    CliSessionState ss = new CliSessionState(conf);
    ss.in = System.in;

    SessionState oldSs = SessionState.get();
    miniClusters.restartSessions(canReuseSession, ss, oldSs);
    closeSession(oldSs);

    SessionState.start(ss);

    cliDriver = new CliDriver();

    File outf = new File(logDir, "initialize.log");
    setSessionOutputs(ss, outf);

  }
Clear out any side effects of running tests
itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java