This is an automated email from the ASF dual-hosted git repository.

iwasakims pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-2.10 by this push:
     new 73ae3ce  HDFS-9376. TestSeveralNameNodes fails occasionally. 
Contributed by Masatake Iwasaki.
73ae3ce is described below

commit 73ae3cee858f6c63caaa1f658fc1ea7f6434aded
Author: cnauroth <cnaur...@apache.org>
AuthorDate: Tue Dec 29 14:37:03 2015 -0800

    HDFS-9376. TestSeveralNameNodes fails occasionally. Contributed by Masatake 
Iwasaki.
    
    (cherry picked from commit 84a81477912644290173518d566b586305b85bf7)
    
     Conflicts:
        hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
---
 .../hadoop/hdfs/server/namenode/ha/TestSeveralNameNodes.java      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestSeveralNameNodes.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestSeveralNameNodes.java
index dbe8070..295e31a 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestSeveralNameNodes.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestSeveralNameNodes.java
@@ -32,6 +32,7 @@ import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
+import org.apache.hadoop.hdfs.client.HdfsClientConfigKeys;
 import org.apache.hadoop.test.MultithreadedTestUtil.RepeatingTestThread;
 import org.apache.hadoop.test.MultithreadedTestUtil.TestContext;
 import org.junit.Test;
@@ -57,6 +58,8 @@ public class TestSeveralNameNodes {
     // setup the harness
     harness.setNumberOfNameNodes(NUM_NAMENODES);
     harness.addFailoverThread(TIME_BETWEEN_FAILOVERS);
+    harness.conf.setInt(HdfsClientConfigKeys.Failover.SLEEPTIME_MAX_KEY, 1000);
+    harness.conf.setInt(HdfsClientConfigKeys.Failover.MAX_ATTEMPTS_KEY, 128);
 
     final MiniDFSCluster cluster = harness.startCluster();
     try {
@@ -78,7 +81,8 @@ public class TestSeveralNameNodes {
 
       // wait for all the writer threads to finish, or that we exceed the time
       long start = System.currentTimeMillis();
-      while ((System.currentTimeMillis() - start) < RUNTIME) {
+      while ((System.currentTimeMillis() - start) < RUNTIME &&
+          writers.size() > 0) {
         for (int i = 0; i < writers.size(); i++) {
           CircularWriter writer = writers.get(i);
           // remove the writer from the ones to check
@@ -176,4 +180,4 @@ public class TestSeveralNameNodes {
       return new Path(dir, Integer.toString(i));
     }
   }
-}
\ No newline at end of file
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to