lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1231247 - /lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java
Date Fri, 13 Jan 2012 18:58:28 GMT
Author: markrmiller
Date: Fri Jan 13 18:58:28 2012
New Revision: 1231247

URL: http://svn.apache.org/viewvc?rev=1231247&view=rev
Log:
respect checkVsControl flag

Modified:
    lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java

Modified: lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java?rev=1231247&r1=1231246&r2=1231247&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java
Fri Jan 13 18:58:28 2012
@@ -883,36 +883,40 @@ public class FullSolrCloudTest extends A
       fail(failMessage);
     }
     
-    // now check that the right # are on each shard
-    theShards = shardToClient.keySet();
-    int cnt = 0;
-    for (String s : theShards) {
-      int times = shardToClient.get(s).size();
-      for (int i = 0; i < times; i++) {
-        try {
-          SolrServer client = shardToClient.get(s).get(i);
-          ZkNodeProps props = clientToInfo.get(new CloudSolrServerClient(client));
-          boolean active = props.get(ZkStateReader.STATE_PROP).equals(ZkStateReader.ACTIVE);
-          if (active) {
-            SolrQuery query = new SolrQuery("*:*");
-            query.set("distrib", false);
-            cnt += client.query(query).getResults()
-                .getNumFound();
-            break;
-          }
-        } catch(SolrServerException e) {
-          // if we have a problem, try the next one
-          if (i == times - 1) {
-            throw e;
+    if (checkVsControl) {
+      // now check that the right # are on each shard
+      theShards = shardToClient.keySet();
+      int cnt = 0;
+      for (String s : theShards) {
+        int times = shardToClient.get(s).size();
+        for (int i = 0; i < times; i++) {
+          try {
+            SolrServer client = shardToClient.get(s).get(i);
+            ZkNodeProps props = clientToInfo.get(new CloudSolrServerClient(
+                client));
+            boolean active = props.get(ZkStateReader.STATE_PROP).equals(
+                ZkStateReader.ACTIVE);
+            if (active) {
+              SolrQuery query = new SolrQuery("*:*");
+              query.set("distrib", false);
+              cnt += client.query(query).getResults().getNumFound();
+              break;
+            }
+          } catch (SolrServerException e) {
+            // if we have a problem, try the next one
+            if (i == times - 1) {
+              throw e;
+            }
           }
         }
       }
+      
+      SolrQuery q = new SolrQuery("*:*");
+      long cloudClientDocs = cloudClient.query(q).getResults().getNumFound();
+      assertEquals(
+          "adding up the # of docs on each shard does not match the control - cloud client
returns:"
+              + cloudClientDocs, docs, cnt);
     }
-    SolrQuery q = new SolrQuery("*:*");
-    long cloudClientDocs = cloudClient.query(q).getResults().getNumFound();
-    assertEquals(
-        "adding up the # of docs on each shard does not match the control - cloud client
returns:"
-            + cloudClientDocs, docs, cnt);
   }
 
   private SolrServer getClient(String nodeName) {



Mime
View raw message