HDFS-3422. TestStandbyIsHot timeouts too aggressive. Contributed by Todd Lipcon.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1339452 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
97e1d5c9ad
commit
ba1e4a823a
@ -206,6 +206,8 @@ Release 2.0.1-alpha - UNRELEASED
|
||||
|
||||
HDFS-3413. TestFailureToReadEdits timing out. (atm)
|
||||
|
||||
HDFS-3422. TestStandbyIsHot timeouts too aggressive (todd)
|
||||
|
||||
Release 2.0.0-alpha - UNRELEASED
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -42,7 +42,6 @@
|
||||
import org.apache.hadoop.hdfs.server.blockmanagement.BlockManager;
|
||||
import org.apache.hadoop.hdfs.server.blockmanagement.BlockManagerTestUtil;
|
||||
import org.apache.hadoop.hdfs.server.datanode.DataNode;
|
||||
import org.apache.hadoop.hdfs.server.datanode.DataNodeTestUtils;
|
||||
import org.apache.hadoop.hdfs.server.namenode.FSNamesystem;
|
||||
import org.apache.hadoop.hdfs.server.namenode.NameNode;
|
||||
import org.apache.hadoop.hdfs.server.namenode.NameNodeAdapter;
|
||||
@ -70,7 +69,7 @@ public class TestStandbyIsHot {
|
||||
((Log4JLogger)NameNode.stateChangeLog).getLogger().setLevel(Level.ALL);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(timeout=60000)
|
||||
public void testStandbyIsHot() throws Exception {
|
||||
Configuration conf = new Configuration();
|
||||
// We read from the standby to watch block locations
|
||||
@ -111,6 +110,8 @@ public void testStandbyIsHot() throws Exception {
|
||||
// Change replication
|
||||
LOG.info("Changing replication to 1");
|
||||
fs.setReplication(TEST_FILE_PATH, (short)1);
|
||||
BlockManagerTestUtil.computeAllPendingWork(
|
||||
nn1.getNamesystem().getBlockManager());
|
||||
waitForBlockLocations(cluster, nn1, TEST_FILE, 1);
|
||||
|
||||
nn1.getRpcServer().rollEditLog();
|
||||
@ -121,6 +122,8 @@ public void testStandbyIsHot() throws Exception {
|
||||
// Change back to 3
|
||||
LOG.info("Changing replication to 3");
|
||||
fs.setReplication(TEST_FILE_PATH, (short)3);
|
||||
BlockManagerTestUtil.computeAllPendingWork(
|
||||
nn1.getNamesystem().getBlockManager());
|
||||
nn1.getRpcServer().rollEditLog();
|
||||
|
||||
LOG.info("Waiting for higher replication to show up on standby");
|
||||
@ -142,7 +145,7 @@ public void testStandbyIsHot() throws Exception {
|
||||
* In the bug, the standby node would only very slowly notice the blocks returning
|
||||
* to the cluster.
|
||||
*/
|
||||
@Test
|
||||
@Test(timeout=60000)
|
||||
public void testDatanodeRestarts() throws Exception {
|
||||
Configuration conf = new Configuration();
|
||||
conf.setInt(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, 1024);
|
||||
@ -224,17 +227,16 @@ public Boolean get() {
|
||||
|
||||
LOG.info("Got " + numReplicas + " locs: " + locs);
|
||||
if (numReplicas > expectedReplicas) {
|
||||
for (DataNode dn : cluster.getDataNodes()) {
|
||||
DataNodeTestUtils.triggerDeletionReport(dn);
|
||||
}
|
||||
cluster.triggerDeletionReports();
|
||||
}
|
||||
cluster.triggerHeartbeats();
|
||||
return numReplicas == expectedReplicas;
|
||||
} catch (IOException e) {
|
||||
LOG.warn("No block locations yet: " + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}, 500, 10000);
|
||||
}, 500, 20000);
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user