private static DataNodeProperties findAndKillFirstDataNode(DatanodeInfo firstDatanodeInfo) {
    assertTrue(firstDatanodeInfo != null);
    ArrayList<DataNode> dataNodes = CLUSTER.getDataNodes();
    ArrayList<Integer> foundIndexes = new ArrayList<Integer>();
    int index = 0;
    for (DataNode dataNode : dataNodes) {
      if (firstDatanodeInfo.getXferAddr().equals(dataNode.getDatanodeId().getXferAddr())) {
        foundIndexes.add(index);
      }
      index++;
    }
    assertTrue(foundIndexes.size() == 1);
    return CLUSTER.stopDataNode(foundIndexes.get(0));
  }
Make sure all the data node channel are closed.
hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/TestFanOutOneBlockAsyncDFSOutputHang.java