You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by th...@apache.org on 2015/08/13 21:06:05 UTC

svn commit: r1695752 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java

Author: thelabdude
Date: Thu Aug 13 19:06:04 2015
New Revision: 1695752

URL: http://svn.apache.org/r1695752
Log:
SOLR-7921: Fix non-reproducible test failure on sarowe's Jenkins by adding a brief wait before checking that tech product docs have been committed to the example server

Modified:
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java?rev=1695752&r1=1695751&r2=1695752&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java Thu Aug 13 19:06:04 2015
@@ -344,7 +344,17 @@ public class TestSolrCLIRunExample exten
       SolrQuery query = new SolrQuery("*:*");
       QueryResponse qr = solrClient.query(query);
       long numFound = qr.getResults().getNumFound();
-      assertTrue("expected 32 docs in the "+exampleName+" example but found " + numFound + ", output: " + toolOutput,
+      if (numFound == 0) {
+        // brief wait in case of timing issue in getting the new docs committed
+        log.warn("Going to wait for 1 second before re-trying query for techproduct example docs ...");
+        try {
+          Thread.sleep(1000);
+        } catch (InterruptedException ignore) {
+          Thread.interrupted();
+        }
+        numFound = solrClient.query(query).getResults().getNumFound();
+      }
+      assertTrue("expected 32 docs in the " + exampleName + " example but found " + numFound + ", output: " + toolOutput,
           numFound == 32);
     }