Bladeren bron

HDFS-4722. Merge r1476597 from trunk

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1486176 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 12 jaren geleden
bovenliggende
commit
f05a2e5b69

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -394,6 +394,9 @@ Release 2.0.5-beta - UNRELEASED
     HDFS-4740. Fixes for a few test failures on Windows.
     (Arpit Agarwal via suresh)
 
+    HDFS-4722. TestGetConf#testFederation times out on Windows.
+    (Ivan Mitic via suresh)
+
 Release 2.0.4-alpha - 2013-04-25
 
   INCOMPATIBLE CHANGES

+ 11 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestGetConf.java

@@ -87,6 +87,16 @@ public class TestGetConf {
     return values;
   }
 
+  /**
+   * Add namenodes to the static resolution list to avoid going
+   * through DNS which can be really slow in some configurations.
+   */
+  private void setupStaticHostResolution(int nameServiceIdCount) {
+    for (int i = 0; i < nameServiceIdCount; i++) {
+      NetUtils.addStaticResolution("nn" + i, "localhost");
+    }
+  }
+
   /*
    * Convert the map returned from DFSUtil functions to an array of
    * addresses represented as "host:port"
@@ -306,6 +316,7 @@ public class TestGetConf {
     String[] nnAddresses = setupAddress(conf,
         DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsCount, 1000);
     setupAddress(conf, DFS_NAMENODE_RPC_ADDRESS_KEY, nsCount, 1500);
+    setupStaticHostResolution(nsCount);
     String[] backupAddresses = setupAddress(conf,
         DFS_NAMENODE_BACKUP_ADDRESS_KEY, nsCount, 2000);
     String[] secondaryAddresses = setupAddress(conf,