Parcourir la source

Fix an intermittent problem running unit tests. Also decrease the
timeout further, to make unit tests run a bit faster.


git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@413766 13f79535-47bb-0310-9956-ffa450edef68

Doug Cutting il y a 19 ans
Parent
commit
339dd30613
1 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 6 2
      src/test/org/apache/hadoop/dfs/MiniDFSCluster.java

+ 6 - 2
src/test/org/apache/hadoop/dfs/MiniDFSCluster.java

@@ -93,12 +93,16 @@ public class MiniDFSCluster {
     conf.set("dfs.data.dir", new File(base_dir, "data").getPath());
     conf.set("dfs.data.dir", new File(base_dir, "data").getPath());
     conf.setInt("dfs.replication", 1);
     conf.setInt("dfs.replication", 1);
     // this timeout seems to control the minimum time for the test, so
     // this timeout seems to control the minimum time for the test, so
-    // set it down at 5 seconds.
-    conf.setInt("ipc.client.timeout", 5000);
+    // decrease it considerably.
+    conf.setInt("ipc.client.timeout", 1000);
     NameNode.format(conf);
     NameNode.format(conf);
     nameNode = new NameNodeRunner();
     nameNode = new NameNodeRunner();
     nameNodeThread = new Thread(nameNode);
     nameNodeThread = new Thread(nameNode);
     nameNodeThread.start();
     nameNodeThread.start();
+    try {                                     // let namenode get started
+      Thread.sleep(1000);
+    } catch(InterruptedException e) {
+    }
     dataNode = new DataNodeRunner();
     dataNode = new DataNodeRunner();
     dataNodeThread = new Thread(dataNode);
     dataNodeThread = new Thread(dataNode);
     dataNodeThread.start();
     dataNodeThread.start();