@Test
  public void testScannerThrowsExceptionWhenCoprocessorThrowsDNRIOE()
    throws IOException, InterruptedException {
    reset();
    IS_DO_NOT_RETRY.set(true);
    TableName tableName = TableName.valueOf(name.getMethodName());
    try (Table t = TEST_UTIL.createTable(tableName, FAMILY)) {
      TEST_UTIL.loadTable(t, FAMILY, false);
      TEST_UTIL.getAdmin().flush(tableName);
      inject();
      TEST_UTIL.countRows(t, new Scan().addColumn(FAMILY, FAMILY));
      fail("Should have thrown an exception");
    } catch (DoNotRetryIOException expected) {
      // expected
    }
    assertTrue(REQ_COUNT.get() > 0);
  }
Tests the case where a coprocessor throws a DoNotRetryIOException in the scan. The expectation
is that the exception will bubble up to the client scanner instead of being retried.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideScanExcpetion.java