You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by zz...@apache.org on 2012/10/25 22:55:04 UTC
git commit: fix TestHelper.verifyClsuter()
Updated Branches:
refs/heads/master a2f2e6e2c -> de588e282
fix TestHelper.verifyClsuter()
Project: http://git-wip-us.apache.org/repos/asf/incubator-helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-helix/commit/de588e28
Tree: http://git-wip-us.apache.org/repos/asf/incubator-helix/tree/de588e28
Diff: http://git-wip-us.apache.org/repos/asf/incubator-helix/diff/de588e28
Branch: refs/heads/master
Commit: de588e2825b850fb5d3e7378d72f0978a3c0ea9d
Parents: a2f2e6e
Author: zzhang <zz...@apache.org>
Authored: Thu Oct 25 13:54:43 2012 -0700
Committer: zzhang <zz...@apache.org>
Committed: Thu Oct 25 13:54:43 2012 -0700
----------------------------------------------------------------------
.../src/test/java/org/apache/helix/TestHelper.java | 8 +-
.../helix/integration/TestCustomIdealState.java | 2 +-
.../apache/helix/integration/TestDropResource.java | 71 +++++++++------
.../integration/TestDynamicFileClusterManager.java | 1 +
.../integration/TestParticipantNameCollision.java | 2 +-
5 files changed, 48 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/de588e28/helix-core/src/test/java/org/apache/helix/TestHelper.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/TestHelper.java b/helix-core/src/test/java/org/apache/helix/TestHelper.java
index 0f53724..1792cac 100644
--- a/helix-core/src/test/java/org/apache/helix/TestHelper.java
+++ b/helix-core/src/test/java/org/apache/helix/TestHelper.java
@@ -229,10 +229,10 @@ public class TestHelper
return set;
}
- public static void verifyWithTimeout(String verifierName, Object... args)
- {
- verifyWithTimeout(verifierName, 30 * 1000, args);
- }
+// public static void verifyWithTimeout(String verifierName, Object... args)
+// {
+// verifyWithTimeout(verifierName, 30 * 1000, args);
+// }
/**
* generic method for verification with a timeout
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/de588e28/helix-core/src/test/java/org/apache/helix/integration/TestCustomIdealState.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestCustomIdealState.java b/helix-core/src/test/java/org/apache/helix/integration/TestCustomIdealState.java
index 90f72a1..0ae7d0a 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestCustomIdealState.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestCustomIdealState.java
@@ -142,7 +142,7 @@ public class TestCustomIdealState extends ZkIntegrationTestBase
ClusterSetup setup = new ClusterSetup(ZK_ADDR);
setup.dropResourceFromCluster(uniqClusterName, "TestDB0");
- TestHelper.verifyWithTimeout("verifyEmptyCurStateAndExtView", uniqClusterName, "TestDB0",
+ TestHelper.verifyWithTimeout("verifyEmptyCurStateAndExtView", 30 * 1000, uniqClusterName, "TestDB0",
TestHelper.<String> setOf("localhost_12918", "localhost_12919", "localhost_12920",
"localhost_12921", "localhost_12922"), ZK_ADDR);
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/de588e28/helix-core/src/test/java/org/apache/helix/integration/TestDropResource.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestDropResource.java b/helix-core/src/test/java/org/apache/helix/integration/TestDropResource.java
index 6f91df5..05a2dc0 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestDropResource.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestDropResource.java
@@ -22,7 +22,6 @@ import org.apache.helix.tools.ClusterStateVerifier;
import org.testng.Assert;
import org.testng.annotations.Test;
-
public class TestDropResource extends ZkStandAloneCMTestBaseWithPropertyServerCheck
{
@Test()
@@ -32,60 +31,72 @@ public class TestDropResource extends ZkStandAloneCMTestBaseWithPropertyServerCh
_setupTool.addResourceToCluster(CLUSTER_NAME, "MyDB", 6, STATE_MODEL);
_setupTool.rebalanceStorageCluster(CLUSTER_NAME, "MyDB", 3);
- boolean result = ClusterStateVerifier.verifyByPolling(
- new ClusterStateVerifier.BestPossAndExtViewZkVerifier(ZK_ADDR, CLUSTER_NAME));
+ boolean result =
+ ClusterStateVerifier.verifyByPolling(new ClusterStateVerifier.BestPossAndExtViewZkVerifier(ZK_ADDR,
+ CLUSTER_NAME));
Assert.assertTrue(result);
- String command = "-zkSvr " + ZK_ADDR + " -dropResource " + CLUSTER_NAME + " " + "MyDB";
+ String command =
+ "-zkSvr " + ZK_ADDR + " -dropResource " + CLUSTER_NAME + " " + "MyDB";
ClusterSetup.processCommandLineArgs(command.split(" "));
TestHelper.verifyWithTimeout("verifyEmptyCurStateAndExtView",
+ 30 * 1000,
CLUSTER_NAME,
"MyDB",
- TestHelper.<String>setOf("localhost_12918", "localhost_12919",
- "localhost_12920", "localhost_12921",
- "localhost_12922"),
+ TestHelper.<String> setOf("localhost_12918",
+ "localhost_12919",
+ "localhost_12920",
+ "localhost_12921",
+ "localhost_12922"),
ZK_ADDR);
}
-
+
@Test()
public void testDropResourceWhileNodeDead() throws Exception
{
- // add a resource to be dropped
+ // add a resource to be dropped
_setupTool.addResourceToCluster(CLUSTER_NAME, "MyDB2", 16, STATE_MODEL);
_setupTool.rebalanceStorageCluster(CLUSTER_NAME, "MyDB2", 3);
-
- boolean verifyResult = ClusterStateVerifier.verifyByPolling(
- new ClusterStateVerifier.BestPossAndExtViewZkVerifier(ZK_ADDR, CLUSTER_NAME));
+
+ boolean verifyResult =
+ ClusterStateVerifier.verifyByPolling(new ClusterStateVerifier.BestPossAndExtViewZkVerifier(ZK_ADDR,
+ CLUSTER_NAME));
Assert.assertTrue(verifyResult);
String hostToKill = "localhost_12920";
-
+
_startCMResultMap.get(hostToKill)._manager.disconnect();
Thread.sleep(1000);
_startCMResultMap.get(hostToKill)._thread.interrupt();
-
- String command = "-zkSvr " + ZK_ADDR + " -dropResource " + CLUSTER_NAME + " " + "MyDB2";
+
+ String command =
+ "-zkSvr " + ZK_ADDR + " -dropResource " + CLUSTER_NAME + " " + "MyDB2";
ClusterSetup.processCommandLineArgs(command.split(" "));
-
+
TestHelper.verifyWithTimeout("verifyEmptyCurStateAndExtView",
- CLUSTER_NAME,
- "MyDB2",
- TestHelper.<String>setOf("localhost_12918", "localhost_12919",
- /*"localhost_12920",*/ "localhost_12921",
- "localhost_12922"),
- ZK_ADDR);
-
+ 30 * 1000,
+ CLUSTER_NAME,
+ "MyDB2",
+ TestHelper.<String> setOf("localhost_12918",
+ "localhost_12919",
+ /* "localhost_12920", */"localhost_12921",
+ "localhost_12922"),
+ ZK_ADDR);
+
StartCMResult result =
TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, hostToKill);
_startCMResultMap.put(hostToKill, result);
-
+
TestHelper.verifyWithTimeout("verifyEmptyCurStateAndExtView",
- CLUSTER_NAME,
- "MyDB2",
- TestHelper.<String>setOf("localhost_12918", "localhost_12919",
- "localhost_12920", "localhost_12921",
- "localhost_12922"),
- ZK_ADDR);
+ 30 * 1000,
+ CLUSTER_NAME,
+ "MyDB2",
+ TestHelper.<String> setOf("localhost_12918",
+ "localhost_12919",
+ "localhost_12920",
+ "localhost_12921",
+ "localhost_12922"),
+ ZK_ADDR);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/de588e28/helix-core/src/test/java/org/apache/helix/integration/TestDynamicFileClusterManager.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestDynamicFileClusterManager.java b/helix-core/src/test/java/org/apache/helix/integration/TestDynamicFileClusterManager.java
index c56bdc2..5251aae 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestDynamicFileClusterManager.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestDynamicFileClusterManager.java
@@ -46,6 +46,7 @@ public class TestDynamicFileClusterManager extends FileCMTestBase
_mgmtTool.dropResource(CLUSTER_NAME, "MyDB");
TestHelper.verifyWithTimeout("verifyEmptyCurStateFile",
+ 30 * 1000,
CLUSTER_NAME,
"MyDB",
TestHelper.<String>setOf("localhost_12918", "localhost_12919",
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/de588e28/helix-core/src/test/java/org/apache/helix/integration/TestParticipantNameCollision.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestParticipantNameCollision.java b/helix-core/src/test/java/org/apache/helix/integration/TestParticipantNameCollision.java
index 9715380..e2859d8 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestParticipantNameCollision.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestParticipantNameCollision.java
@@ -50,7 +50,7 @@ public class TestParticipantNameCollision extends ZkStandAloneCMTestBase
Thread.sleep(30000);
- TestHelper.verifyWithTimeout("verifyNotConnected", result._manager);
+ TestHelper.verifyWithTimeout("verifyNotConnected", 30 * 1000, result._manager);
logger.info("STOP TestParticipantNameCollision() at " + new Date(System.currentTimeMillis()));
}