alirezazamani commented on a change in pull request #981:
URL: https://github.com/apache/helix/pull/981#discussion_r418322612
##########
File path:
helix-core/src/test/java/org/apache/helix/integration/task/TestRebalanceRunningTask.java
##########
@@ -261,6 +263,31 @@ public void
testFixedTargetTaskAndDisabledRebalanceAndNodeAdded() throws Interru
new
BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME).setZkClient(_gZkClient)
.setResources(Sets.newHashSet(DATABASE)).build();
Assert.assertTrue(clusterVerifier.verify(10 * 1000));
+
+ // Wait until master is switched to new instance and two masters existed
on two different instance
+ boolean isMasterOnTwoDifferentNodes = TestHelper.verify(() -> {
+ HashSet<String> masterInstances = new HashSet<>();
Review comment:
Done.
##########
File path:
helix-core/src/test/java/org/apache/helix/integration/task/TestRebalanceRunningTask.java
##########
@@ -261,6 +263,31 @@ public void
testFixedTargetTaskAndDisabledRebalanceAndNodeAdded() throws Interru
new
BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME).setZkClient(_gZkClient)
.setResources(Sets.newHashSet(DATABASE)).build();
Assert.assertTrue(clusterVerifier.verify(10 * 1000));
+
+ // Wait until master is switched to new instance and two masters existed
on two different instance
+ boolean isMasterOnTwoDifferentNodes = TestHelper.verify(() -> {
+ HashSet<String> masterInstances = new HashSet<>();
+ ExternalView externalView =
+
_gSetupTool.getClusterManagementTool().getResourceExternalView(CLUSTER_NAME,
DATABASE);
+ if (externalView == null) {
+ return false;
+ }
+ Map<String, String> stateMap0 = externalView.getStateMap(DATABASE +
"_0");
+ Map<String, String> stateMap1 = externalView.getStateMap(DATABASE +
"_1");
+ for (Map.Entry<String, String> entry : stateMap0.entrySet()) {
+ if (entry.getValue().equals("MASTER")) {
+ masterInstances.add(entry.getKey());
+ }
+ }
+ for (Map.Entry<String, String> entry : stateMap1.entrySet()) {
+ if (entry.getValue().equals("MASTER")) {
+ masterInstances.add(entry.getKey());
+ }
+ }
+ return (masterInstances.size() == 2);
Review comment:
Done.
##########
File path:
helix-core/src/test/java/org/apache/helix/integration/task/TestRebalanceRunningTask.java
##########
@@ -261,6 +263,31 @@ public void
testFixedTargetTaskAndDisabledRebalanceAndNodeAdded() throws Interru
new
BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME).setZkClient(_gZkClient)
.setResources(Sets.newHashSet(DATABASE)).build();
Assert.assertTrue(clusterVerifier.verify(10 * 1000));
+
+ // Wait until master is switched to new instance and two masters existed
on two different instance
Review comment:
Fixed.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]