@Test
  public void testTimeoutEventProcedure() throws Exception {
    final int NTIMEOUTS = 5;

    TestTimeoutEventProcedure proc = new TestTimeoutEventProcedure(500, NTIMEOUTS);
    procExecutor.submitProcedure(proc);

    ProcedureTestingUtility.waitProcedure(procExecutor, proc.getProcId());
    ProcedureTestingUtility.assertIsAbortException(procExecutor.getResult(proc.getProcId()));
    assertEquals(NTIMEOUTS + 1, proc.getTimeoutsCount());
  }
Tests being able to suspend a Procedure for N timeouts and then failing.s Resets the timeout
after each elapses. See {@link TestTimeoutEventProcedure} for example of how to do this sort of
trickery with the ProcedureExecutor; i.e. suspend for a while, check for a condition and if not
set, suspend again, etc., ultimately failing or succeeding eventually.
hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureEvents.java