mcvsubbu commented on a change in pull request #4047: Create 
leadControllerResource in helix cluster
URL: https://github.com/apache/incubator-pinot/pull/4047#discussion_r290050920
 
 

 ##########
 File path: 
pinot-controller/src/test/java/org/apache/pinot/controller/helix/PinotControllerModeTest.java
 ##########
 @@ -67,6 +72,25 @@ public void testDualModeController()
         "Failed to start " + config.getControllerMode() + " controller in " + 
TIMEOUT_IN_MS + "ms.");
     Assert.assertEquals(_controllerStarter.getControllerMode(), 
ControllerConf.ControllerMode.DUAL);
 
+    // Enable the lead controller resource.
+    _helixAdmin.enableResource(getHelixClusterName(), 
CommonConstants.Helix.LEAD_CONTROLLER_RESOURCE_NAME, true);
+
+    // Starting a second dual-mode controller.
+    ControllerConf controllerConfig = getDefaultControllerConfiguration();
+    controllerConfig.setHelixClusterName(getHelixClusterName());
+    controllerConfig.setControllerMode(ControllerConf.ControllerMode.DUAL);
+    
controllerConfig.setControllerPort(Integer.toString(Integer.parseInt(this.config.getControllerPort())
 + controllerPortOffset++));
+
+    ControllerStarter secondDualModeController = new 
TestOnlyControllerStarter(controllerConfig);
+    secondDualModeController.start();
+    TestUtils.waitForCondition(
+        aVoid -> 
secondDualModeController.getHelixResourceManager().getHelixZkManager().isConnected(),
 TIMEOUT_IN_MS,
+        "Failed to start " + config.getControllerMode() + " controller in " + 
TIMEOUT_IN_MS + "ms.");
+    Assert.assertEquals(secondDualModeController.getControllerMode(), 
ControllerConf.ControllerMode.DUAL);
+
+    Thread.sleep(100000_000L);
 
 Review comment:
   clean up

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to