hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1310616 - in /hadoop/common/branches/HDFS-3042/hadoop-common-project/hadoop-common: CHANGES.HDFS-3042.txt src/test/java/org/apache/hadoop/ha/TestZKFailoverControllerStress.java
Date Fri, 06 Apr 2012 22:16:34 GMT
Author: todd
Date: Fri Apr  6 22:16:33 2012
New Revision: 1310616

URL: http://svn.apache.org/viewvc?rev=1310616&view=rev
Log:
HADOOP-8257. TestZKFailoverControllerStress occasionally fails with Mockito error. Contributed
by Todd Lipcon.

Modified:
    hadoop/common/branches/HDFS-3042/hadoop-common-project/hadoop-common/CHANGES.HDFS-3042.txt
    hadoop/common/branches/HDFS-3042/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestZKFailoverControllerStress.java

Modified: hadoop/common/branches/HDFS-3042/hadoop-common-project/hadoop-common/CHANGES.HDFS-3042.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3042/hadoop-common-project/hadoop-common/CHANGES.HDFS-3042.txt?rev=1310616&r1=1310615&r2=1310616&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3042/hadoop-common-project/hadoop-common/CHANGES.HDFS-3042.txt
(original)
+++ hadoop/common/branches/HDFS-3042/hadoop-common-project/hadoop-common/CHANGES.HDFS-3042.txt
Fri Apr  6 22:16:33 2012
@@ -11,3 +11,5 @@ HADOOP-8228. Auto HA: Refactor tests and
 HADOOP-8215. Security support for ZK Failover controller (todd)
 
 HADOOP-8245. Fix flakiness in TestZKFailoverController (todd)
+
+HADOOP-8257. TestZKFailoverControllerStress occasionally fails with Mockito error (todd)

Modified: hadoop/common/branches/HDFS-3042/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestZKFailoverControllerStress.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3042/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestZKFailoverControllerStress.java?rev=1310616&r1=1310615&r2=1310616&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3042/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestZKFailoverControllerStress.java
(original)
+++ hadoop/common/branches/HDFS-3042/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestZKFailoverControllerStress.java
Fri Apr  6 22:16:33 2012
@@ -47,7 +47,6 @@ public class TestZKFailoverControllerStr
     conf = new Configuration();
     conf.set(ZKFailoverController.ZK_QUORUM_KEY, hostPort);
     this.cluster = new MiniZKFCCluster(conf, getServer(serverFactory));
-    cluster.start();
   }
   
   @After
@@ -61,6 +60,7 @@ public class TestZKFailoverControllerStr
    */
   @Test(timeout=(STRESS_RUNTIME_SECS + EXTRA_TIMEOUT_SECS) * 1000)
   public void testExpireBackAndForth() throws Exception {
+    cluster.start();
     long st = System.currentTimeMillis();
     long runFor = STRESS_RUNTIME_SECS * 1000;
 
@@ -86,6 +86,7 @@ public class TestZKFailoverControllerStr
    */
   @Test(timeout=(STRESS_RUNTIME_SECS + EXTRA_TIMEOUT_SECS) * 1000)
   public void testRandomExpirations() throws Exception {
+    cluster.start();
     long st = System.currentTimeMillis();
     long runFor = STRESS_RUNTIME_SECS * 1000;
 
@@ -119,6 +120,11 @@ public class TestZKFailoverControllerStr
         .when(cluster.getService(1).proxy).monitorHealth();
     ActiveStandbyElector.NUM_RETRIES = 100;
     
+    // Don't start until after the above mocking. Otherwise we can get
+    // Mockito errors if the HM calls the proxy in the middle of
+    // setting up the mock.
+    cluster.start();
+    
     long st = System.currentTimeMillis();
     while (System.currentTimeMillis() - st < runFor) {
       cluster.getTestContext().checkException();



Mime
View raw message