@Override
    protected Flow executeFromState(MasterProcedureEnv env, RegionStateTransitionState state)
      throws ProcedureSuspendedException, ProcedureYieldException, InterruptedException {
      // add a sleep so we will not consume all the CPUs and write a bunch of logs
      Thread.sleep(100);
      switch (state) {
        case REGION_STATE_TRANSITION_GET_ASSIGN_CANDIDATE:
          LOG.info("LATCH1 {}", this.latch.getCount());
          this.latch.countDown();
          setNextState(REGION_STATE_TRANSITION_OPEN);
          return Flow.HAS_MORE_STATE;
        case REGION_STATE_TRANSITION_OPEN:
          if (latch.getCount() == 0) {
            LOG.info("LATCH3 {}", this.latch.getCount());
            return Flow.NO_MORE_STATE;
          } else {
            LOG.info("LATCH2 {}", this.latch.getCount());
            return Flow.HAS_MORE_STATE;
          }
        default:
          throw new UnsupportedOperationException("unhandled state=" + state);
      }
    }
An AssignProcedure that Stalls just before the finish.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionBypass.java