You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2017/10/04 08:25:00 UTC
[08/50] [abbrv] lucene-solr:master: SOLR-9735: Test fixes after merge
from master
SOLR-9735: Test fixes after merge from master
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/6fc9d4ce
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/6fc9d4ce
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/6fc9d4ce
Branch: refs/heads/master
Commit: 6fc9d4ce034f672cf001f4ffb80ad166d53dd253
Parents: 2a6acd3
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Sat Aug 19 17:58:58 2017 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Sat Aug 19 17:58:58 2017 +0530
----------------------------------------------------------------------
.../autoscaling/AutoScalingHandlerTest.java | 32 ++++++++------------
1 file changed, 13 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6fc9d4ce/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
index 6a1f08e..79879e8 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
@@ -357,7 +357,7 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
"}";
String removeListenerCommand1 = "{\n" +
"\t\"remove-listener\" : {\n" +
- "\t\t\"name\" : \".system\"\n" +
+ "\t\t\"name\" : \"node_lost_trigger.system\"\n" +
"\t}\n" +
"}";
req = createAutoScalingRequest(SolrRequest.METHOD.POST, removeListenerCommand);
@@ -655,18 +655,7 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
assertNotNull(violations);
assertEquals(0, violations.size());
- String setEmptyClusterPolicyCommand = "{" +
- " 'set-cluster-policy': []" +
- "}";
- req = createAutoScalingRequest(SolrRequest.METHOD.POST, setEmptyClusterPolicyCommand);
- response = solrClient.request(req);
- assertEquals(response.get("result").toString(), "success");
-
- req = createAutoScalingRequest(SolrRequest.METHOD.POST, "{set-cluster-policy : []}");
- response = solrClient.request(req);
- assertEquals(response.get("result").toString(), "success");
-
- // lets create a collection which violates the rule replicas < 2
+ // assert that when a cluster policy is in effect, using maxShardsPerNode throws an exception
try {
CollectionAdminRequest.Create create = CollectionAdminRequest.Create.createCollection("readApiTestViolations", CONFIGSET_NAME, 1, 6);
create.setMaxShardsPerNode(10);
@@ -674,9 +663,19 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
fail();
} catch (Exception e) {
assertTrue(e.getMessage().contains("'maxShardsPerNode>0' is not supported when autoScaling policies are used"));
-
}
+ // temporarily increase replica limit in cluster policy so that we can create a collection with 6 replicas
+ String tempClusterPolicyCommand = "{" +
+ " 'set-cluster-policy': [" +
+ " {'cores':'<10', 'node':'#ANY'}," +
+ " {'replica':'<4', 'shard': '#EACH', 'node': '#ANY'}," +
+ " {'nodeRole':'overseer', 'replica':0}" +
+ " ]" +
+ "}";
+ req = createAutoScalingRequest(SolrRequest.METHOD.POST, tempClusterPolicyCommand);
+ response = solrClient.request(req);
+ assertEquals(response.get("result").toString(), "success");
// lets create a collection which violates the rule replicas < 2
CollectionAdminRequest.Create create = CollectionAdminRequest.Create.createCollection("readApiTestViolations", CONFIGSET_NAME, 1, 6);
@@ -688,11 +687,6 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
response = solrClient.request(req);
assertEquals(response.get("result").toString(), "success");
- req = createAutoScalingRequest(SolrRequest.METHOD.POST, setClusterPolicyCommand);
- response = solrClient.request(req);
- assertEquals(response.get("result").toString(), "success");
-
-
// get the diagnostics output again
req = createAutoScalingRequest(SolrRequest.METHOD.GET, "/diagnostics", null);
response = solrClient.request(req);