lei-xia commented on a change in pull request #336: #334 Fix invoke rebalance
by "touching" IdealState/ResourceConfig
URL: https://github.com/apache/helix/pull/336#discussion_r304178434
##########
File path:
helix-core/src/test/java/org/apache/helix/util/TestRebalanceScheduler.java
##########
@@ -0,0 +1,62 @@
+package org.apache.helix.util;
+
+import java.util.Arrays;
+import java.util.Collections;
+import org.apache.commons.math.stat.inference.TestUtils;
+import org.apache.helix.ConfigAccessor;
+import org.apache.helix.HelixManager;
+import org.apache.helix.HelixManagerFactory;
+import org.apache.helix.InstanceType;
+import org.apache.helix.ZkUnitTestBase;
+import org.apache.helix.common.ZkTestBase;
+import org.apache.helix.controller.rebalancer.util.RebalanceScheduler;
+import org.apache.helix.model.IdealState;
+import org.apache.helix.model.MasterSlaveSMD;
+import org.apache.helix.model.ResourceConfig;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class TestRebalanceScheduler extends ZkTestBase {
+ private final String CLASS_NAME = getShortClassName();
+ private final String CLUSTER_NAME = CLUSTER_PREFIX + "_" + CLASS_NAME;
+ private HelixManager _manager;
+ private ConfigAccessor _configAccessor;
+ private final int NUM_ATTEMPTS = 10;
+
+ @BeforeClass
+ public void beforeClass() throws Exception {
+ _gSetupTool.addCluster(CLUSTER_NAME, true);
+ _manager = HelixManagerFactory
+ .getZKHelixManager(CLUSTER_NAME, "Test", InstanceType.ADMINISTRATOR,
ZK_ADDR);
+ _manager.connect();
+ _configAccessor = new ConfigAccessor(_gZkClient);
+ }
+
+ @Test
+ public void testInvokeRebalanceAndInvokeRebalanceForResource() {
Review comment:
In your test, can you also validate the record has actually been changed,
i.e, the version of znode is increased?
----------------------------------------------------------------
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