@Test
  public void testFullSystemBubblesFSErrors() throws Exception {
    // We won't have an error if the datanode is not there if we use short circuit
    // it's a known 'feature'.
    Assume.assumeTrue(!util.isReadShortCircuitOn());

    try {
      // Make it fail faster.
      util.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1);
      util.getConfiguration().setInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 90000);
      util.getConfiguration().setInt("hbase.lease.recovery.timeout", 10000);
      util.getConfiguration().setInt("hbase.lease.recovery.dfs.timeout", 1000);
      util.startMiniCluster(1);
      final TableName tableName = TableName.valueOf(name.getMethodName());
      byte[] fam = Bytes.toBytes("fam");

      Admin admin = util.getAdmin();
      TableDescriptor tableDescriptor =
        TableDescriptorBuilder.newBuilder(tableName).setColumnFamily(ColumnFamilyDescriptorBuilder
          .newBuilder(fam).setMaxVersions(1).setBlockCacheEnabled(false).build()).build();
      admin.createTable(tableDescriptor);

      // Make a new Configuration so it makes a new connection that has the
      // above configuration on it; else we use the old one w/ 10 as default.
      try (Table table = util.getConnection().getTable(tableName)) {
        // Load some data
        util.loadTable(table, fam, false);
        util.flush();
        HBaseTestingUtil.countRows(table);

        // Kill the DFS cluster
        util.getDFSCluster().shutdownDataNodes();

        try {
          HBaseTestingUtil.countRows(table);
          fail("Did not fail to count after removing data");
        } catch (Exception e) {
          LOG.info("Got expected error", e);
          assertTrue(e.getMessage().contains("Could not seek"));
        }
      }

      // Restart data nodes so that HBase can shut down cleanly.
      util.getDFSCluster().restartDataNodes();

    } finally {
      SingleProcessHBaseCluster cluster = util.getMiniHBaseCluster();
      if (cluster != null) cluster.killAll();
      util.shutdownMiniCluster();
    }
  }
Cluster test which starts a region server with a region, then removes the data from HDFS
underneath it, and ensures that errors are bubbled to the client.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java