@Test
  public void testInitialChorePrecedence() throws InterruptedException {
    final int period = 100;
    final int failureThreshold = 5;
    ScheduledChore chore = new FailInitialChore("chore", period, failureThreshold);
    service.scheduleChore(chore);

    int loopCount = 0;
    boolean brokeOutOfLoop = false;

    while (!chore.isInitialChoreComplete() && chore.isScheduled()) {
      Thread.sleep(failureThreshold * period);
      loopCount++;
      if (loopCount > 3) {
        brokeOutOfLoop = true;
        break;
      }
    }

    assertFalse(brokeOutOfLoop);
  }
@param failThreshold Number of times the Chore fails when trying to execute initialChore
                     before succeeding.
hbase-common/src/test/java/org/apache/hadoop/hbase/TestChoreService.java