@Before
  public void setUp() throws Exception {
    TestTxnDbUtil.prepDb(conf);
    MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.METRICS_ENABLED, true);
    txnMgr = TxnManagerFactory.getTxnManagerFactory().getTxnManager(conf);
    txnMgr.getLockManager();//init lock manager
    Assert.assertTrue(txnMgr instanceof DbTxnManager);
    nextInput = 1;
    readEntities = new HashSet<ReadEntity>();
    writeEntities = new HashSet<WriteEntity>();
    MetastoreConf.setTimeVar(conf, MetastoreConf.ConfVars.TXN_TIMEOUT, 10, TimeUnit.SECONDS);
    houseKeeperService = new AcidHouseKeeperService();
    MetastoreConf.setTimeVar(conf, MetastoreConf.ConfVars.REPL_TXN_TIMEOUT, 30, TimeUnit.SECONDS);
    houseKeeperService.setConf(conf);
    // re-initialize metrics
    Metrics.shutdown();
    Metrics.initialize(conf);
  }
Same as testHeartbeater, but testing cleanup of replication txns (TxnType.REPL_CREATED)
Note: in TestDbTxnManager metastore.repl.txn.timeout is set to 30s for testing purposes.
ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager.java