(short) 3, 0);
// Remove the datanode, enter safemode and restart it.
ns.removeDatanode(dns.get(0));
ns.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
cluster.restartDataNodes();
// Wait for a block report.
long start = System.currentTimeMillis();
while (System.currentTimeMillis() - start < 10000
&& ns.getSafeBlocks() != 1) {