@Test
  public void testMinimumNumberOfThreads() throws Exception {
    Configuration conf = UTIL.getConfiguration();
    String confKey = "hbase.test.cleaner.delegates";
    conf.set(confKey, AlwaysDelete.class.getName());
    conf.set(CleanerChore.CHORE_POOL_SIZE, "2");
    int numProcs = Runtime.getRuntime().availableProcessors();
    // Sanity
    assertEquals(numProcs, CleanerChore.calculatePoolSize(Integer.toString(numProcs)));
    // The implementation does not allow us to set more threads than we have processors
    assertEquals(numProcs, CleanerChore.calculatePoolSize(Integer.toString(numProcs + 2)));
    // Force us into the branch that is multiplying 0.0 against the number of processors
    assertEquals(1, CleanerChore.calculatePoolSize("0.0"));
  }
The cleaner runs in a loop, where it first checks to see all the files under a directory can be
deleted. If they all can, then we try to delete the directory. However, a file may be added
that directory to after the original check. This ensures that we don't accidentally delete that
directory on and don't get spurious IOExceptions.
<p>
This was from HBASE-7465.
@throws Exception on failure
hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestCleanerChore.java