You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by er...@apache.org on 2018/01/13 19:30:53 UTC

lucene-solr:branch_7x: SOLR-11389: Fix test failures resulting from SOLR-11218

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x 37e2faa8a -> 6f85f17bb


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

(cherry picked from commit c110472)


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

Branch: refs/heads/branch_7x
Commit: 6f85f17bbf2ea3a0991dfae25c81d6190915beda
Parents: 37e2faa
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:24:32 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/6f85f17b/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/6f85f17b/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index fee6477..f805ab4 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -79,6 +79,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/6f85f17b/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);
     }