You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2018/12/10 00:32:06 UTC
[08/16] lucene-solr:master: SOLR-12801: harden
CollectionsAPIDistributedZkTest
SOLR-12801: harden CollectionsAPIDistributedZkTest
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/906e32af
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/906e32af
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/906e32af
Branch: refs/heads/master
Commit: 906e32af1384fe5ece66beb57e8f8619afd1807b
Parents: 65bfb16
Author: markrmiller <ma...@apache.org>
Authored: Sun Dec 9 00:28:15 2018 -0600
Committer: markrmiller <ma...@apache.org>
Committed: Sun Dec 9 18:31:28 2018 -0600
----------------------------------------------------------------------
.../CollectionsAPIDistributedZkTest.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/906e32af/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java
index d019dd8..42a2e40 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java
@@ -474,20 +474,20 @@ public class CollectionsAPIDistributedZkTest extends SolrCloudTestCase {
.add("id", "7")
.add("id", "8")
.commit(cluster.getSolrClient(), collectionName);
+ long numFound = 0;
TimeOut timeOut = new TimeOut(10, TimeUnit.SECONDS, TimeSource.NANO_TIME);
while (!timeOut.hasTimedOut()) {
- try {
- long numFound = cluster.getSolrClient().query(collectionName, new SolrQuery("*:*")).getResults().getNumFound();
- assertEquals(3, numFound);
+
+ numFound = cluster.getSolrClient().query(collectionName, new SolrQuery("*:*")).getResults().getNumFound();
+ if (numFound == 3) {
break;
- } catch (Exception e) {
- // Query node can have stale clusterstate
- log.info("Error when query " + collectionName, e);
- Thread.sleep(500);
}
+
+ Thread.sleep(500);
}
+
if (timeOut.hasTimedOut()) {
- fail("Timeout on query " + collectionName);
+ fail("Timeout waiting to see 3 found, instead saw " + numFound + " for collection " + collectionName);
}
checkNoTwoShardsUseTheSameIndexDir();