diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDatanodeRegistration.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDatanodeRegistration.java index 37042dbb17..77aeff4d2c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDatanodeRegistration.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDatanodeRegistration.java @@ -364,14 +364,16 @@ public void testForcedRegistration() throws Exception { waitForHeartbeat(dn, dnd); assertTrue(dnd.isRegistered()); assertSame(lastReg, dn.getDNRegistrationForBP(bpId)); - assertTrue(waitForBlockReport(dn, dnd)); + assertTrue("block report is not processed for DN " + dnd, + waitForBlockReport(dn, dnd)); assertTrue(dnd.isRegistered()); assertSame(lastReg, dn.getDNRegistrationForBP(bpId)); // check that block report is not processed and registration didn't // change. dnd.setForceRegistration(true); - assertFalse(waitForBlockReport(dn, dnd)); + assertFalse("block report is processed for DN " + dnd, + waitForBlockReport(dn, dnd)); assertFalse(dnd.isRegistered()); assertSame(lastReg, dn.getDNRegistrationForBP(bpId)); @@ -382,7 +384,8 @@ public void testForcedRegistration() throws Exception { newReg = dn.getDNRegistrationForBP(bpId); assertNotSame(lastReg, newReg); lastReg = newReg; - assertTrue(waitForBlockReport(dn, dnd)); + assertTrue("block report is not processed for DN " + dnd, + waitForBlockReport(dn, dnd)); assertTrue(dnd.isRegistered()); assertSame(lastReg, dn.getDNRegistrationForBP(bpId)); @@ -447,8 +450,9 @@ private boolean waitForBlockReport(final DataNode dn, public Boolean get() { return lastCount != storage.getBlockReportCount(); } - }, 10, 2000); + }, 10, 6000); } catch (TimeoutException te) { + LOG.error("Timeout waiting for block report for {}", dnd); return false; } return true;