FSDataset fsd = null;
for (DataNode dn : cluster.getDataNodes()) {
if (portSet.contains(dn.getPort())) {
fsd = (FSDataset) (dn.data);
TestCase.assertNotNull(fsd);
DatanodeBlockInfo binfo = fsd.getDatanodeBlockInfo(nsId,
locatedblock.getBlock());
TestCase.assertNotNull(binfo);
long waitTimeLeft = 20000;
while (true) {
if (binfo.hasBlockCrcInfo()) {
break;
} else {
if (waitTimeLeft > 0) {
waitTimeLeft -= 100;
System.out.println("Sleep while waiting for datanode " + dn