jiajunwang commented on a change in pull request #681: Integration test for 
controller connect and disconnect
URL: https://github.com/apache/helix/pull/681#discussion_r366728978
 
 

 ##########
 File path: 
helix-core/src/test/java/org/apache/helix/integration/controller/TestControllerLeadershipChange.java
 ##########
 @@ -20,29 +20,136 @@
  */
 
 import java.lang.management.ManagementFactory;
+import java.util.List;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
 import org.apache.helix.AccessOption;
 import org.apache.helix.HelixDataAccessor;
 import org.apache.helix.HelixManager;
 import org.apache.helix.HelixManagerFactory;
+import org.apache.helix.HelixTimerTask;
 import org.apache.helix.InstanceType;
 import org.apache.helix.PropertyPathBuilder;
 import org.apache.helix.common.ZkTestBase;
+import org.apache.helix.integration.manager.ClusterControllerManager;
 import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.CallbackHandler;
+import org.apache.helix.manager.zk.client.HelixZkClient;
 import org.apache.helix.model.IdealState;
 import org.apache.helix.model.LiveInstance;
 import org.apache.helix.monitoring.mbeans.MonitorDomainNames;
 import 
org.apache.helix.tools.ClusterVerifiers.BestPossibleExternalViewVerifier;
 import org.apache.helix.tools.ClusterVerifiers.ZkHelixClusterVerifier;
 import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
+
+/**
+ * Integration test on controller leadership on several phases given the test 
cluster:
+ *  1. When a standby node becomes the leader node
+ *     - single leader node mode
+ *  2. When a leader node becomes standby node
+ *     - single leader node mode
+ *  3. When a leader node becomes standby node and the other leader node 
becomes leader node
+ *     - The dual leader nodes mode when the leadership of the test cluster 
gets changed
+ */
 public class TestControllerLeadershipChange extends ZkTestBase {
+  private final String CLASS_NAME = getShortClassName();
+  private final String CLUSTER_NAME = "TestCluster-" + CLASS_NAME;
+
+  @BeforeClass
+  public void beforeClass()
+      throws Exception {
+    super.beforeClass();
+    _gSetupTool.addCluster(CLUSTER_NAME, true);
+    // add some instances
+    _gSetupTool.addInstanceToCluster(CLUSTER_NAME, "TestInstance");
+    _gSetupTool.addResourceToCluster(CLUSTER_NAME, "TestResource", 10, 
"MasterSlave");
+  }
 
   @Test
-  public void testMissingTopStateDurationMonitoring() throws Exception {
+  public void testOnSingleController() {
 
 Review comment:
   I think we have the same test case, or a similar test case. For example, 
TestStandAloneCMMain.java, there is more related test cases. The existing tests 
are actually more complicated than this one.
   I'm fine if you want to re-org the test so they are together. But can we 
remove the old duplicated tests and ensure we keep the most complicated cases 
in our test list?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to