You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2018/08/16 20:06:34 UTC

lucene-solr:branch_7x: SOLR-12392: Improve reliability of IndexSizeTriggerTest.

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x 68c3b989d -> e8597218d


SOLR-12392: Improve reliability of IndexSizeTriggerTest.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e8597218
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e8597218
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e8597218

Branch: refs/heads/branch_7x
Commit: e8597218d0c23e9f1119ce7f6f8bd10eb1022985
Parents: 68c3b98
Author: Andrzej Bialecki <ab...@apache.org>
Authored: Thu Aug 16 22:05:27 2018 +0200
Committer: Andrzej Bialecki <ab...@apache.org>
Committed: Thu Aug 16 22:06:28 2018 +0200

----------------------------------------------------------------------
 .../cloud/autoscaling/IndexSizeTriggerTest.java | 21 ++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e8597218/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java
index 4b6f2ea..b476505 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java
@@ -47,6 +47,7 @@ import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.cloud.ZkNodeProps;
 import org.apache.solr.common.params.CollectionParams;
 import org.apache.solr.common.params.CommonParams;
+import org.apache.solr.common.params.UpdateParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.Pair;
 import org.apache.solr.common.util.TimeSource;
@@ -92,7 +93,7 @@ public class IndexSizeTriggerTest extends SolrCloudTestCase {
     configureCluster(2)
         .addConfig("conf", configset("cloud-minimal"))
         .configure();
-    if (random().nextBoolean() && false) {
+    if (random().nextBoolean()) {
       cloudManager = cluster.getJettySolrRunner(0).getCoreContainer().getZkController().getSolrCloudManager();
       solrClient = cluster.getSolrClient();
       loader = cluster.getJettySolrRunner(0).getCoreContainer().getResourceLoader();
@@ -442,10 +443,6 @@ public class IndexSizeTriggerTest extends SolrCloudTestCase {
   @Test
   //@BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 05-Jul-2018
   public void testMixedBounds() throws Exception {
-//    if (cloudManager instanceof SimCloudManager) {
-//      log.warn("Requires SOLR-12208");
-//      return;
-//    }
 
     String collectionName = "testMixedBounds_collection";
     CollectionAdminRequest.Create create = CollectionAdminRequest.createCollection(collectionName,
@@ -605,15 +602,23 @@ public class IndexSizeTriggerTest extends SolrCloudTestCase {
     response = solrClient.request(req);
     assertEquals(response.get("result").toString(), "success");
 
-    for (int j = 0; j < 8; j++) {
+    for (int j = 0; j < 10; j++) {
       UpdateRequest ureq = new UpdateRequest();
       ureq.setParam("collection", collectionName);
-      for (int i = 0; i < 95; i++) {
+      for (int i = 0; i < 98; i++) {
         ureq.deleteById("id-" + (i * 100) + "-" + j);
       }
       solrClient.request(ureq);
     }
-    solrClient.commit(collectionName);
+    // make sure the actual index size is reduced by deletions, otherwise we may still violate aboveBytes
+    UpdateRequest ur = new UpdateRequest();
+    ur.setParam(UpdateParams.COMMIT, "true");
+    ur.setParam(UpdateParams.EXPUNGE_DELETES, "true");
+    ur.setParam(UpdateParams.OPTIMIZE, "true");
+    ur.setParam(UpdateParams.MAX_OPTIMIZE_SEGMENTS, "1");
+    ur.setParam(UpdateParams.WAIT_SEARCHER, "true");
+    ur.setParam(UpdateParams.OPEN_SEARCHER, "true");
+    solrClient.request(ur, collectionName);
 
     // resume trigger
     req = createAutoScalingRequest(SolrRequest.METHOD.POST, resumeTriggerCommand);