helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiajunw...@apache.org
Subject [helix] branch master updated: Fix the unstable test TestWagedRebalance.testRebalancerReset. (#735)
Date Sun, 09 Feb 2020 05:06:28 GMT
This is an automated email from the ASF dual-hosted git repository.

jiajunwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git


The following commit(s) were added to refs/heads/master by this push:
     new 637e943  Fix the unstable test TestWagedRebalance.testRebalancerReset. (#735)
637e943 is described below

commit 637e9434f33d8fe671b3354c8914c5c1547cb764
Author: Jiajun Wang <1803880+jiajunwang@users.noreply.github.com>
AuthorDate: Sat Feb 8 21:06:21 2020 -0800

    Fix the unstable test TestWagedRebalance.testRebalancerReset. (#735)
    
    Manually trigger the new session handling so there is no possible race condition in the
test case.
---
 .../integration/rebalancer/WagedRebalancer/TestWagedRebalance.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/helix-core/src/test/java/org/apache/helix/integration/rebalancer/WagedRebalancer/TestWagedRebalance.java
b/helix-core/src/test/java/org/apache/helix/integration/rebalancer/WagedRebalancer/TestWagedRebalance.java
index 96180bf..1b804d1 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/rebalancer/WagedRebalancer/TestWagedRebalance.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/rebalancer/WagedRebalancer/TestWagedRebalance.java
@@ -33,6 +33,7 @@ import org.apache.helix.TestHelper;
 import org.apache.helix.common.ZkTestBase;
 import org.apache.helix.controller.rebalancer.strategy.CrushEdRebalanceStrategy;
 import org.apache.helix.controller.rebalancer.strategy.CrushRebalanceStrategy;
+import org.apache.helix.controller.rebalancer.util.RebalanceScheduler;
 import org.apache.helix.integration.manager.ClusterControllerManager;
 import org.apache.helix.integration.manager.MockParticipantManager;
 import org.apache.helix.model.BuiltInStateModelDefinitions;
@@ -514,8 +515,10 @@ public class TestWagedRebalance extends ZkTestBase {
     ExternalView oldEV =
         _gSetupTool.getClusterManagementTool().getResourceExternalView(CLUSTER_NAME, moreDB);
 
-    // Expire the controller session so it will reset the internal rebalancer's status.
-    simulateSessionExpiry(_controller.getZkClient());
+    _controller.handleNewSession();
+    // Trigger a rebalance to test if the rebalancer calculate with empty cache states.
+    RebalanceScheduler.invokeRebalance(_controller.getHelixDataAccessor(), moreDB);
+
     // After reset done, the rebalancer will try to rebalance all the partitions since it
has
     // forgotten the previous state.
     // TODO remove this sleep after fix https://github.com/apache/helix/issues/526


Mime
View raw message