You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/06/24 00:13:15 UTC

[GitHub] [lucene-solr] noblepaul commented on a change in pull request #1598: SOLR-14409: Existing violations allow bypassing policy rules when add…

noblepaul commented on a change in pull request #1598:
URL: https://github.com/apache/lucene-solr/pull/1598#discussion_r444575124



##########
File path: solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy2.java
##########
@@ -516,6 +517,16 @@ public void testInfiniteLoop() {
     System.out.println(suggestions);
   }
 
+  public void testAddTooManyPerPolicy() {
+    Map<String, Object> m = (Map<String, Object>) loadFromResource("testAddTooManyPerPolicy.json");
+    SolrCloudManager cloudManagerFromDiagnostics = createCloudManagerFromDiagnostics(m);
+    AutoScalingConfig autoScalingConfig = new AutoScalingConfig((Map<String, Object>) getObjectByPath(m, false, "diagnostics/config"));
+    SolrException exp =  expectThrows(SolrException.class, () -> PolicyHelper.getReplicaLocations("TooManyPerPolicy", autoScalingConfig, cloudManagerFromDiagnostics,
+            EMPTY_MAP, Collections.singletonList("shard1"), 1, 0, 0, null));
+    assertTrue(exp.getMessage().contains("No node can satisfy the rules"));

Review comment:
       what's the difference?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org