private void waitForCounter(LongAdder ctr, long oldval, long newval, long timems)
    throws InterruptedException {
    long curt = EnvironmentEdgeManager.currentTime();
    long endt = curt + timems;
    while (curt < endt) {
      if (ctr.sum() == oldval) {
        Thread.sleep(100);
        curt = EnvironmentEdgeManager.currentTime();
      } else {
        assertEquals(newval, ctr.sum());
        return;
      }
    }
    fail();
  }
Base class for testing distributed log splitting.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestDLS.java