@BeforeClass
  public static void setUp() throws Exception {
    UTIL.getConfiguration().setClass(HConstants.MASTER_IMPL, MockHMaster.class, HMaster.class);
    UTIL.startMiniCluster(3);
  }
All the modification method will fail once in the test and should finally succeed.
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationProcedureRetry.java