@Test
  public void nothingToCleanAfterAbortsDelta() throws Exception {
    String dbName = "default";
    String tableName = "camtc";
    Table t = newTable(dbName, tableName, false);

    addDeltaFile(t, null, 20L, 20L, 1);
    addDeltaFile(t, null, 21L, 21L, 2);
    addDeltaFile(t, null, 22L, 22L, 2);
    burnThroughTransactions(dbName, tableName, 22, null, new HashSet<Long>(Arrays.asList(21L, 22L)));

    CompactionRequest rqst = new CompactionRequest(dbName, tableName, CompactionType.MAJOR);

    compactInTxn(rqst);
    CompactionResponse response = txnHandler.compact(rqst);

    Assert.assertFalse(response.isAccepted());
    Assert.assertEquals("Compaction is already scheduled with state='ready for cleaning' and id=1", response.getErrormessage());

    startCleaner();

    ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
    Assert.assertEquals(1, rsp.getCompactsSize());
    Assert.assertEquals(TxnStore.SUCCEEDED_RESPONSE, rsp.getCompacts().get(0).getState());

    List<Path> paths = getDirectories(conf, t, null);
    Assert.assertEquals(1, paths.size());
    Assert.assertEquals(makeDeltaDirName(20,20), paths.get(0).getName());
  }
Tests for the compactor Cleaner thread
ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCleaner.java