diff --git a/hadoop-common-project/hadoop-common/CHANGES.HDFS-3042.txt b/hadoop-common-project/hadoop-common/CHANGES.HDFS-3042.txt index 07e919f3e0d..968e0426348 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.HDFS-3042.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.HDFS-3042.txt @@ -11,3 +11,5 @@ HADOOP-8228. Auto HA: Refactor tests and add stress tests. (todd) 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) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestZKFailoverControllerStress.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestZKFailoverControllerStress.java index 508bb001996..c1c27265e60 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestZKFailoverControllerStress.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestZKFailoverControllerStress.java @@ -47,7 +47,6 @@ public class TestZKFailoverControllerStress extends ClientBaseWithFixes { 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 TestZKFailoverControllerStress extends ClientBaseWithFixes { */ @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 TestZKFailoverControllerStress extends ClientBaseWithFixes { */ @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 TestZKFailoverControllerStress extends ClientBaseWithFixes { .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();