helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject [3/4] helix git commit: Fix NPE in TestRoutingTableProvider.
Date Mon, 16 Apr 2018 18:24:20 GMT
Fix NPE in TestRoutingTableProvider.


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/012e7806
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/012e7806
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/012e7806

Branch: refs/heads/master
Commit: 012e780607604f1ecfc57f86c11466e4f89240c5
Parents: 47d790e
Author: Lei Xia <lxia@linkedin.com>
Authored: Tue Apr 3 17:24:30 2018 -0700
Committer: Lei Xia <lxia@linkedin.com>
Committed: Mon Apr 16 11:22:40 2018 -0700

----------------------------------------------------------------------
 .../CrushRebalancers/TestCrushAutoRebalanceNonRack.java          | 2 +-
 .../helix/integration/spectator/TestRoutingTableProvider.java    | 4 ++--
 helix-core/src/test/java/org/apache/helix/mock/MockManager.java  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/012e7806/helix-core/src/test/java/org/apache/helix/integration/rebalancer/CrushRebalancers/TestCrushAutoRebalanceNonRack.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/rebalancer/CrushRebalancers/TestCrushAutoRebalanceNonRack.java
b/helix-core/src/test/java/org/apache/helix/integration/rebalancer/CrushRebalancers/TestCrushAutoRebalanceNonRack.java
index 42ce528..1a41e08 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/rebalancer/CrushRebalancers/TestCrushAutoRebalanceNonRack.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/rebalancer/CrushRebalancers/TestCrushAutoRebalanceNonRack.java
@@ -220,7 +220,7 @@ public class TestCrushAutoRebalanceNonRack extends ZkStandAloneCMTestBase
{
       p.syncStop();
       _setupTool.getClusterManagementTool()
           .enableInstance(CLUSTER_NAME, p.getInstanceName(), false);
-      Thread.sleep(50);
+      Thread.sleep(200);
       _setupTool.dropInstanceFromCluster(CLUSTER_NAME, p.getInstanceName());
     }
 

http://git-wip-us.apache.org/repos/asf/helix/blob/012e7806/helix-core/src/test/java/org/apache/helix/integration/spectator/TestRoutingTableProvider.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/spectator/TestRoutingTableProvider.java
b/helix-core/src/test/java/org/apache/helix/integration/spectator/TestRoutingTableProvider.java
index ff35dbd..b34e447 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/spectator/TestRoutingTableProvider.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/spectator/TestRoutingTableProvider.java
@@ -61,8 +61,8 @@ public class TestRoutingTableProvider extends ZkIntegrationTestBase {
       for (InstanceConfig config : routingTableSnapshot.getInstancesForResource(TEST_DB,
"SLAVE")) {
         slaveInstances.add(config.getInstanceName());
       }
-      if (!masterInstances.equals(Map.class.cast(context).get("MASTER")) || !slaveInstances
-          .equals(Map.class.cast(context).get("SLAVE"))) {
+      if (context != null && (!masterInstances.equals(Map.class.cast(context).get("MASTER"))
+          || !slaveInstances.equals(Map.class.cast(context).get("SLAVE")))) {
         _listenerTestResult = false;
       } else {
         _listenerTestResult = true;

http://git-wip-us.apache.org/repos/asf/helix/blob/012e7806/helix-core/src/test/java/org/apache/helix/mock/MockManager.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/mock/MockManager.java b/helix-core/src/test/java/org/apache/helix/mock/MockManager.java
index 109b016..349712f 100644
--- a/helix-core/src/test/java/org/apache/helix/mock/MockManager.java
+++ b/helix-core/src/test/java/org/apache/helix/mock/MockManager.java
@@ -45,6 +45,7 @@ import org.apache.helix.PropertyKey;
 import org.apache.helix.ZNRecord;
 import org.apache.helix.healthcheck.ParticipantHealthReportCollector;
 import org.apache.helix.model.HelixConfigScope;
+import org.apache.helix.participant.HelixStateMachineEngine;
 import org.apache.helix.participant.StateMachineEngine;
 import org.apache.helix.store.zk.ZkHelixPropertyStore;
 
@@ -237,8 +238,7 @@ public class MockManager implements HelixManager {
 
   @Override
   public StateMachineEngine getStateMachineEngine() {
-    // TODO Auto-generated method stub
-    return null;
+    return new HelixStateMachineEngine(this);
   }
 
   @Override


Mime
View raw message