private void doTest(boolean skipWAL) throws IOException {
    TableName tableName = TableName.valueOf(TN + (skipWAL ? "_skipWAL" : ""));
    TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName)
      .setRegionReplication(3).setColumnFamily(ColumnFamilyDescriptorBuilder.of(CF));
    if (skipWAL) {
      builder.setDurability(Durability.SKIP_WAL);
    }
    TableDescriptor td = builder.build();
    HTU.getAdmin().createTable(td);

    try (Table table = HTU.getConnection().getTable(tableName)) {
      for (int i = 0; i < 500; i++) {
        table.put(new Put(Bytes.toBytes(i)).addColumn(CF, CQ, Bytes.toBytes(i)));
      }
      HTU.waitFor(30000, () -> checkReplica(table, 2));
      HTU.waitFor(30000, () -> checkReplica(table, 1));
    }
  }
Test region replication when error occur.
<p/>
We can not simply move the secondary replicas as we will trigger a flush for the primary replica
when secondary replica is online, which will always make the data of the two regions in sync. So
here we need to simulate request errors.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicaReplicationError.java