commit 757a98fa35d01590c5e09de98f7c99d804f2ba4e Author: Todd Lipcon Date: Wed Mar 16 18:19:05 2011 -0700 HBASE-3659. Fix TestHLog for newer Hadoop versions Reason: fixes test failure against CDH3 Author: Todd Lipcon Ref: CDH-2827 diff --git src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java index 08ba8cb..f4d3943 100644 --- src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java +++ src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java @@ -107,6 +107,9 @@ public class TestHLog { .setInt("ipc.client.connect.max.retries", 1); TEST_UTIL.getConfiguration().setInt( "dfs.client.block.recovery.retries", 1); + TEST_UTIL.getConfiguration().setInt( + "ipc.client.connection.maxidletime", 500); + TEST_UTIL.startMiniCluster(3); conf = TEST_UTIL.getConfiguration(); @@ -365,6 +368,13 @@ public class TestHLog { LOG.error("Waiting for cluster to go down"); Thread.sleep(1000); } + + // Workaround a strange issue with Hadoop's RPC system - if we don't + // sleep here, the new datanodes will pick up a cached IPC connection to + // the old (dead) NN and fail to start. Sleeping 2 seconds goes past + // the idle time threshold configured in the conf above + Thread.sleep(2000); + cluster = new MiniDFSCluster(namenodePort, conf, 5, false, true, true, null, null, null, null); cluster.waitActive(); fs = cluster.getFileSystem();