You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2018/01/15 02:21:28 UTC

[10/13] lucene-solr:jira/solr-11702: SOLR-11389: Fix test failures resulting from SOLR-11218

SOLR-11389: Fix test failures resulting from SOLR-11218


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

Branch: refs/heads/jira/solr-11702
Commit: c110472eaa97540255dd3768081880b23b02907f
Parents: fe86ab9
Author: Erick Erickson <er...@apache.org>
Authored: Sat Jan 13 11:16:51 2018 -0800
Committer: Erick Erickson <er...@apache.org>
Committed: Sat Jan 13 11:16:51 2018 -0800

----------------------------------------------------------------------
 lucene/common-build.xml                         |  3 ++-
 solr/CHANGES.txt                                |  2 ++
 .../TimeRoutedAliasUpdateProcessorTest.java     | 20 ++++++++------------
 3 files changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c110472e/lucene/common-build.xml
----------------------------------------------------------------------
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index 663e733..f6f4da3 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -1309,7 +1309,8 @@ ant test "-Dtests.method=*esi*"
 ant test -Dtests.seed=DEADBEEF
 
 # Repeats _all_ tests of ClassName N times. Every test repetition
-# will have a different seed.
+# will have a different seed. NOTE: does not reinitialize
+# between repetitions, use only for idempotent tests.
 ant test -Dtests.iters=N -Dtestcase=ClassName
 
 # Repeats _all_ tests of ClassName N times. Every test repetition

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c110472e/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 799637d..b14d79e 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -99,6 +99,8 @@ Bug Fixes
 * SOLR-11631: The Schema API should return non-zero status when there are failures.
   (Noble Paul, Steve Rowe)
 
+* SOLR-11839: Fix test failures resulting from SOLR-11218 (Erick Erickson)
+
 Optimizations
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c110472e/solr/core/src/test/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessorTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessorTest.java
index db4b877..102377d 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessorTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessorTest.java
@@ -50,7 +50,6 @@ import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.util.DefaultSolrThreadFactory;
 import org.junit.AfterClass;
-import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -77,14 +76,6 @@ public class TimeRoutedAliasUpdateProcessorTest extends SolrCloudTestCase {
     IOUtils.close(solrClient);
   }
 
-  //TODO this is necessary when -Dtests.iters but why? Some other tests aren't affected
-  @Before
-  public void doBefore() throws Exception {
-    for (String col : CollectionAdminRequest.listCollections(solrClient)) {
-      CollectionAdminRequest.deleteCollection(col).process(solrClient);
-    }
-  }
-
   @Test
   public void test() throws Exception {
     // First create a config using REST API.  To do this, we create a collection with the name of the eventual config.
@@ -260,9 +251,14 @@ public class TimeRoutedAliasUpdateProcessorTest extends SolrCloudTestCase {
         System.err.println("Docs committed sooner than expected.  Bug or slow test env?");
         return;
       }
-      // wait until it's committed, plus some play time for commit to become visible
-      Thread.sleep(commitWithin + 200);
-      numDocs = queryNumDocs();
+      // wait until it's committed
+      Thread.sleep(commitWithin);
+      for (int idx = 0; idx < 100; ++idx) { // Loop for up to 10 seconds waiting for commit to catch up
+        numDocs = queryNumDocs();
+        if (numDocsBefore + solrInputDocuments.length == numDocs) break;
+        Thread.sleep(100);
+      }
+
       assertEquals("not committed.  Bug or a slow test?",
           numDocsBefore + solrInputDocuments.length, numDocs);
     }