@Test
  public void cleansAllCommittedTxns() throws Exception {
    for (int i = 0; i < 5; ++i) {
      long txnid = openTxn();
      txnHandler.commitTxn(new CommitTxnRequest(txnid));
    }
    Assert.assertEquals(5 + 1, getTxnCount());
    Thread.sleep(txnHandler.getOpenTxnTimeOutMillis() * 2);

    underTest.run();

    // always leaves the MAX(TXN_ID) in the TXNS table
    Assert.assertEquals(1, getTxnCount());
    Assert.assertTrue("The max txnId should be at least 5", getMaxTxnId() >= 5);
  }
Testing whether AcidTxnCleanerService removes the correct records
from the TXNS table (via TxnStore).
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/txn/TestAcidTxnCleanerService.java