@Test
  public void testErrorBeforeUpdate() throws IOException, ReplicationException {
    ((MockHMaster) UTIL.getHBaseCluster().getMaster()).reset(true);
    doTest();
  }
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