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 2014/03/24 18:16:05 UTC

svn commit: r1580922 - in /lucene/dev/trunk/solr/solrj/src: test-files/solrj/solr/solr.xml test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java

Author: markrmiller
Date: Mon Mar 24 17:16:05 2014
New Revision: 1580922

URL: http://svn.apache.org/r1580922
Log:
SOLR-5880: Try syncing solrj test solr.xml up with core test solr.xml.

Modified:
    lucene/dev/trunk/solr/solrj/src/test-files/solrj/solr/solr.xml
    lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java

Modified: lucene/dev/trunk/solr/solrj/src/test-files/solrj/solr/solr.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/test-files/solrj/solr/solr.xml?rev=1580922&r1=1580921&r2=1580922&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/test-files/solrj/solr/solr.xml (original)
+++ lucene/dev/trunk/solr/solrj/src/test-files/solrj/solr/solr.xml Mon Mar 24 17:16:05 2014
@@ -28,8 +28,16 @@
   adminPath: RequestHandler path to manage cores.  
     If 'null' (or absent), cores will not be manageable via request handler
   -->
-  <cores adminPath="/admin/cores" defaultCoreName="collection1" host="127.0.0.1" hostPort="${hostPort:8983}" hostContext="${hostContext:solr}" zkClientTimeout="8000" genericCoreNodeNames="${genericCoreNodeNames:true}">
+  <cores adminPath="/admin/cores" defaultCoreName="collection1" host="127.0.0.1" hostPort="${hostPort:8983}" 
+         hostContext="${hostContext:solr}" zkClientTimeout="${solr.zkclienttimeout:30000}" shareSchema="${shareSchema:false}" 
+         genericCoreNodeNames="${genericCoreNodeNames:true}" leaderVoteWait="0"
+         distribUpdateConnTimeout="${distribUpdateConnTimeout:45000}" distribUpdateSoTimeout="${distribUpdateSoTimeout:340000}">
     <core name="collection1" instanceDir="collection1" shard="${shard:}" collection="${collection:collection1}" />
     <!--config="${solrconfig:solrconfig.xml}" schema="${schema:schema.xml}"/-->
+    <shardHandlerFactory name="shardHandlerFactory" class="HttpShardHandlerFactory">
+      <str name="urlScheme">${urlScheme:}</str>
+      <int name="socketTimeout">${socketTimeout:90000}</int>
+      <int name="connTimeout">${connTimeout:15000}</int>
+    </shardHandlerFactory>
   </cores>
 </solr>

Modified: lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java?rev=1580922&r1=1580921&r2=1580922&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java (original)
+++ lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java Mon Mar 24 17:16:05 2014
@@ -109,7 +109,7 @@ public class CloudSolrServerTest extends
   public CloudSolrServerTest() {
     super();
     sliceCount = 2;
-    shardCount = 4;
+    shardCount = 3;
   }
   
   @Override
@@ -236,9 +236,16 @@ public class CloudSolrServerTest extends
         expectedBaseURLs.size() < requestCountsMap.size());
 
     // Calculate a number of shard keys that route to the same shard.
+    int n;
+    if (TEST_NIGHTLY) {
+      n = random().nextInt(999) + 1;
+    } else {
+      n = random().nextInt(9) + 1;
+    }
+    
     List<String> sameShardRoutes = Lists.newArrayList();
     sameShardRoutes.add("0");
-    for (int i = 1; i < 1000; i++) {
+    for (int i = 1; i < n; i++) {
       String shardKey = Integer.toString(i);
       Collection<Slice> slices = router.getSearchSlicesSingle(shardKey, null, col);
       if (expectedSlices.equals(slices)) {
@@ -248,8 +255,8 @@ public class CloudSolrServerTest extends
 
     assertTrue(sameShardRoutes.size() > 1);
 
-    // Do 1000 queries with _route_ parameter to the same shard
-    for (int i = 0; i < 1000; i++) {
+    // Do N queries with _route_ parameter to the same shard
+    for (int i = 0; i < n; i++) {
       ModifiableSolrParams solrParams = new ModifiableSolrParams();
       solrParams.set(CommonParams.Q, "*:*");
       solrParams.set(ShardParams._ROUTE_, sameShardRoutes.get(random().nextInt(sameShardRoutes.size())));
@@ -278,7 +285,7 @@ public class CloudSolrServerTest extends
       }
     }
 
-    assertEquals("Unexpected number of requests to expected URLs", 1000, increaseFromExpectedUrls);
+    assertEquals("Unexpected number of requests to expected URLs", n, increaseFromExpectedUrls);
     assertEquals("Unexpected number of requests to unexpected URLs: " + numRequestsToUnexpectedUrls,
         0, increaseFromUnexpectedUrls);
 
@@ -312,7 +319,6 @@ public class CloudSolrServerTest extends
     indexDoc(doc);
   }
   
-  @BadApple(bugUrl = "https://issues.apache.org/jira/browse/SOLR-5880")
   public void testShutdown() throws MalformedURLException {
     CloudSolrServer server = new CloudSolrServer("[ff01::114]:33332");
     try {