This is an automated email from the ASF dual-hosted git repository.
jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push:
new fcc6994 Fix the flakiness of PinotControllerModeTest by enabling the
periodic rebalance (#4487)
fcc6994 is described below
commit fcc6994b2577d72007d8bfb896ba7e4469bd6d8c
Author: Xiaotian (Jackie) Jiang <[email protected]>
AuthorDate: Wed Jul 31 15:37:37 2019 -0700
Fix the flakiness of PinotControllerModeTest by enabling the periodic
rebalance (#4487)
---
.../controller/helix/PinotControllerModeTest.java | 34 ++++++++++------------
1 file changed, 15 insertions(+), 19 deletions(-)
diff --git
a/pinot-controller/src/test/java/org/apache/pinot/controller/helix/PinotControllerModeTest.java
b/pinot-controller/src/test/java/org/apache/pinot/controller/helix/PinotControllerModeTest.java
index 14461be..c7a0ce2 100644
---
a/pinot-controller/src/test/java/org/apache/pinot/controller/helix/PinotControllerModeTest.java
+++
b/pinot-controller/src/test/java/org/apache/pinot/controller/helix/PinotControllerModeTest.java
@@ -49,12 +49,11 @@ public class PinotControllerModeTest extends ControllerTest
{
// Start a Helix-only controller
ControllerConf helixOnlyControllerConfig =
getDefaultControllerConfiguration();
helixOnlyControllerConfig.setControllerMode(ControllerConf.ControllerMode.HELIX_ONLY);
- ControllerStarter helixOnlyController =
getControllerStarter(helixOnlyControllerConfig);
- helixOnlyController.start();
- TestUtils.waitForCondition(aVoid ->
helixOnlyController.getHelixControllerManager().isConnected(), TIMEOUT_IN_MS,
+ startController(helixOnlyControllerConfig);
+ TestUtils.waitForCondition(aVoid -> _helixManager.isConnected(),
TIMEOUT_IN_MS,
"Failed to start the Helix-only controller");
- helixOnlyController.stop();
+ stopController();
}
@Test
@@ -62,23 +61,20 @@ public class PinotControllerModeTest extends ControllerTest
{
// Start the first dual-mode controller
ControllerConf firstDualModeControllerConfig =
getDefaultControllerConfiguration();
firstDualModeControllerConfig.setControllerMode(ControllerConf.ControllerMode.DUAL);
- ControllerStarter firstDualModeController =
getControllerStarter(firstDualModeControllerConfig);
- firstDualModeController.start();
- HelixManager helixControllerManager =
firstDualModeController.getHelixControllerManager();
- HelixAdmin helixAdmin = helixControllerManager.getClusterManagmentTool();
- TestUtils.waitForCondition(aVoid -> helixControllerManager.isConnected(),
TIMEOUT_IN_MS,
+ startController(firstDualModeControllerConfig);
+ TestUtils.waitForCondition(aVoid -> _helixManager.isConnected(),
TIMEOUT_IN_MS,
"Failed to start the first dual-mode controller");
// There should be no partition in the external view because the resource
is disabled
TestUtils.waitForCondition(aVoid -> {
ExternalView leadControllerResourceExternalView =
- helixAdmin.getResourceExternalView(getHelixClusterName(),
LEAD_CONTROLLER_RESOURCE_NAME);
+ _helixAdmin.getResourceExternalView(getHelixClusterName(),
LEAD_CONTROLLER_RESOURCE_NAME);
return leadControllerResourceExternalView.getPartitionSet().isEmpty();
}, TIMEOUT_IN_MS, "There should be no partition in the disabled resource's
external view");
// Enable the lead controller resource, and the first controller should be
the MASTER for all partitions
- helixAdmin.enableResource(getHelixClusterName(),
LEAD_CONTROLLER_RESOURCE_NAME, true);
- checkInstanceState(helixAdmin, "MASTER");
+ _helixAdmin.enableResource(getHelixClusterName(),
LEAD_CONTROLLER_RESOURCE_NAME, true);
+ checkInstanceState(_helixAdmin, "MASTER");
// Start the second dual-mode controller
ControllerConf secondDualModeControllerConfig =
getDefaultControllerConfiguration();
@@ -91,22 +87,22 @@ public class PinotControllerModeTest extends ControllerTest
{
TIMEOUT_IN_MS, "Failed to start the second dual-mode controller");
// There should still be only one MASTER instance for each partition
- checkInstanceState(helixAdmin, "MASTER");
+ checkInstanceState(_helixAdmin, "MASTER");
// Disable the lead controller resource, and there should be only one
OFFLINE instance for each partition
- helixAdmin.enableResource(getHelixClusterName(),
LEAD_CONTROLLER_RESOURCE_NAME, false);
- checkInstanceState(helixAdmin, "OFFLINE");
+ _helixAdmin.enableResource(getHelixClusterName(),
LEAD_CONTROLLER_RESOURCE_NAME, false);
+ checkInstanceState(_helixAdmin, "OFFLINE");
// Re-enable the lead controller resource, and there should be only one
MASTER instance for each partition
- helixAdmin.enableResource(getHelixClusterName(),
LEAD_CONTROLLER_RESOURCE_NAME, true);
- checkInstanceState(helixAdmin, "MASTER");
+ _helixAdmin.enableResource(getHelixClusterName(),
LEAD_CONTROLLER_RESOURCE_NAME, true);
+ checkInstanceState(_helixAdmin, "MASTER");
// Stop the second controller, and there should still be only one MASTER
instance for each partition
secondDualModeController.stop();
- checkInstanceState(helixAdmin, "MASTER");
+ checkInstanceState(_helixAdmin, "MASTER");
// Stop the first controller
- firstDualModeController.stop();
+ stopController();
}
// TODO: enable it after removing ControllerLeadershipManager which requires
both CONTROLLER and PARTICIPANT
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]