private void testTimeoutEventProcedureDoubleExecution(final boolean killIfSuspended)
    throws Exception {
    TestTimeoutEventProcedure proc = new TestTimeoutEventProcedure(1000, 3);
    ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExecutor, true);
    ProcedureTestingUtility.setKillIfSuspended(procExecutor, killIfSuspended);
    long procId = procExecutor.submitProcedure(proc);
    ProcedureTestingUtility.testRecoveryAndDoubleExecution(procExecutor, procId, true);
    ProcedureTestingUtility.assertIsAbortException(procExecutor.getResult(proc.getProcId()));
  }
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