helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hu...@apache.org
Subject [helix] 16/44: Fix tests in Helix REST
Date Sat, 25 May 2019 01:19:50 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit c5a3984dc1da4045f7cdde362cf818194aff00a5
Author: Junkai Xue <jxue@linkedin.com>
AuthorDate: Wed Apr 10 13:47:19 2019 -0700

    Fix tests in Helix REST
    
    RB=1627064
    G=helix-reviewers
    A=jjwang
    
    Signed-off-by: Hunter Lee <hulee@linkedin.com>
---
 .../apache/helix/rest/server/TestInstancesAccessor.java   | 15 +++++++++------
 .../apache/helix/rest/server/TestPerInstanceAccessor.java |  4 ++--
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/helix-rest/src/test/java/org/apache/helix/rest/server/TestInstancesAccessor.java
b/helix-rest/src/test/java/org/apache/helix/rest/server/TestInstancesAccessor.java
index 2d9b420..80b4292 100644
--- a/helix-rest/src/test/java/org/apache/helix/rest/server/TestInstancesAccessor.java
+++ b/helix-rest/src/test/java/org/apache/helix/rest/server/TestInstancesAccessor.java
@@ -38,10 +38,13 @@ public class TestInstancesAccessor extends AbstractTestClass {
             .post(this, Entity.entity(content, MediaType.APPLICATION_JSON_TYPE));
     String checkResult = response.readEntity(String.class);
     Assert.assertEquals(checkResult,
-        "{\n  \"instance_stoppable_parallel\" : [ \"instance0\", \"instance2\" ],\n"
-            + "  \"instance_not_stoppable_with_reasons\" : {\n    \"instance1\" : [ \"Helix:EMPTY_RESOURCE_ASSIGNMENT\",
\"Helix:INSTANCE_NOT_ENABLED\", \"Helix:INSTANCE_NOT_STABLE\" ],\n"
-            + "    \"instance3\" : [ \"Helix:HAS_DISABLED_PARTITION\" ],\n"
-            + "    \"instance4\" : [ \"Helix:EMPTY_RESOURCE_ASSIGNMENT\", \"Helix:INSTANCE_NOT_STABLE\",
\"Helix:INSTANCE_NOT_ALIVE\" ]\n  }\n}\n");
+        "{\n  \"instance_stoppable_parallel\" : [ ],\n"
+            + "  \"instance_not_stoppable_with_reasons\" : {\n"
+            + "    \"instance0\" : [ \"Helix:MIN_ACTIVE_REPLICA_CHECK_FAILED\" ],\n"
+            + "    \"instance1\" : [ \"Helix:INSTANCE_NOT_STABLE\", \"Helix:INSTANCE_NOT_ENABLED\",
\"Helix:EMPTY_RESOURCE_ASSIGNMENT\" ],\n"
+            + "    \"instance2\" : [ \"Helix:MIN_ACTIVE_REPLICA_CHECK_FAILED\" ],\n"
+            + "    \"instance3\" : [ \"Helix:HAS_DISABLED_PARTITION\", \"Helix:MIN_ACTIVE_REPLICA_CHECK_FAILED\"
],\n"
+            + "    \"instance4\" : [ \"Helix:INSTANCE_NOT_STABLE\", \"Helix:INSTANCE_NOT_ALIVE\",
\"Helix:EMPTY_RESOURCE_ASSIGNMENT\" ]\n  }\n}\n");
 
     // Disable one selected instance0, it should failed to check
     String instance = "instance0";
@@ -56,7 +59,7 @@ public class TestInstancesAccessor extends AbstractTestClass {
         .format(STOPPABLE_CLUSTER, instance).post(this, entity);
     checkResult = response.readEntity(String.class);
     Assert.assertEquals(checkResult,
-        "{\"stoppable\":false,\"failedChecks\":[\"Helix:HAS_DISABLED_PARTITION\",\"Helix:INSTANCE_NOT_ENABLED\",\"Helix:INSTANCE_NOT_STABLE\"]}");
+        "{\"stoppable\":false,\"failedChecks\":[\"Helix:INSTANCE_NOT_STABLE\",\"Helix:HAS_DISABLED_PARTITION\",\"Helix:INSTANCE_NOT_ENABLED\",\"Helix:MIN_ACTIVE_REPLICA_CHECK_FAILED\"]}");
 
     // Reenable instance0, it should passed the check
     instanceConfig.setInstanceEnabled(true);
@@ -72,7 +75,7 @@ public class TestInstancesAccessor extends AbstractTestClass {
         .format(STOPPABLE_CLUSTER, instance).post(this, entity);
     checkResult = response.readEntity(String.class);
     Assert.assertEquals(checkResult,
-        "{\"stoppable\":true,\"failedChecks\":[]}");
+        "{\"stoppable\":false,\"failedChecks\":[\"Helix:MIN_ACTIVE_REPLICA_CHECK_FAILED\"]}");
   }
 
   @Test(dependsOnMethods = "testEndToEndChecks")
diff --git a/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java
b/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java
index f58bc69..199c82b 100644
--- a/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java
+++ b/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java
@@ -65,8 +65,8 @@ public class TestPerInstanceAccessor extends AbstractTestClass {
         .format(STOPPABLE_CLUSTER, "instance1").post(this, entity);
     String stoppableCheckResult = response.readEntity(String.class);
     Assert.assertEquals(stoppableCheckResult,
-        "{\"stoppable\":false,\"failedChecks\":[\"Helix:EMPTY_RESOURCE_ASSIGNMENT\","
-            + "\"Helix:INSTANCE_NOT_ENABLED\",\"Helix:INSTANCE_NOT_STABLE\"]}");
+        "{\"stoppable\":false,\"failedChecks\":[\"Helix:INSTANCE_NOT_STABLE\","
+            + "\"Helix:INSTANCE_NOT_ENABLED\",\"Helix:EMPTY_RESOURCE_ASSIGNMENT\"]}");
   }
 
   @Test (dependsOnMethods = "testIsInstanceStoppable")


Mime
View raw message