You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2017/10/09 22:23:29 UTC

helix git commit: Fix unstable test for release

Repository: helix
Updated Branches:
  refs/heads/master 188969926 -> a52c70cee


Fix unstable test for release


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/a52c70ce
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/a52c70ce
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/a52c70ce

Branch: refs/heads/master
Commit: a52c70cee5097c28df342cf4181e9d2a2446d7b3
Parents: 1889699
Author: Junkai Xue <jx...@linkedin.com>
Authored: Mon Oct 9 14:17:58 2017 -0700
Committer: Junkai Xue <jx...@linkedin.com>
Committed: Mon Oct 9 15:21:47 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/helix/integration/TestZkReconnect.java  | 2 +-
 .../test/java/org/apache/helix/manager/zk/TestZkClient.java | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/a52c70ce/helix-core/src/test/java/org/apache/helix/integration/TestZkReconnect.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestZkReconnect.java b/helix-core/src/test/java/org/apache/helix/integration/TestZkReconnect.java
index 8288608..b80ce44 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestZkReconnect.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestZkReconnect.java
@@ -126,7 +126,7 @@ public class TestZkReconnect {
 
     LOG.info("Wait for OFFLINE->ONLINE state transition");
     try {
-      Assert.assertTrue(latch.await(10, TimeUnit.SECONDS));
+      Assert.assertTrue(latch.await(15, TimeUnit.SECONDS));
 
       // wait until stable state
       boolean result =

http://git-wip-us.apache.org/repos/asf/helix/blob/a52c70ce/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkClient.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkClient.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkClient.java
index 1c86877..4db65d0 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkClient.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkClient.java
@@ -19,6 +19,7 @@ package org.apache.helix.manager.zk;
  * under the License.
  */
 
+import java.util.Random;
 import org.I0Itec.zkclient.IZkStateListener;
 import org.I0Itec.zkclient.ZkConnection;
 import org.apache.helix.HelixException;
@@ -37,6 +38,7 @@ import org.testng.annotations.Test;
 
 public class TestZkClient extends ZkUnitTestBase {
   private static Logger LOG = Logger.getLogger(TestZkClient.class);
+  private static final String elems = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
   ZkClient _zkClient;
 
@@ -116,7 +118,12 @@ public class TestZkClient extends ZkUnitTestBase {
 
   @Test(expectedExceptions = HelixException.class, expectedExceptionsMessageRegExp = "Data size larger than 1M.*")
   void testDataSizeLimit() {
-    ZNRecord data = new ZNRecord(new String(new char[1024*1024*128]));
+    StringBuilder str = new StringBuilder();
+    Random random = new Random();
+    for (int i = 0; i < 1024 * 1024 * 2; i++) {
+      str.append(elems.charAt(random.nextInt(elems.length())));
+    }
+    ZNRecord data = new ZNRecord(str.toString());
     _zkClient.writeData("/test", data, -1);
   }
 }