Skip to content

Apache Lucene open-source search software

SOLR-5880: Try syncing solrj test solr.xml up with core test solr.xml.

Mark Robert Miller69aee419673a
diff --git a/solr/solrj/src/test-files/solrj/solr/solr.xml b/solr/solrj/src/test-files/solrj/solr/solr.xml
index be8a4d79702..c5d6baceb36 100644
--- a/solr/solrj/src/test-files/solrj/solr/solr.xml
+++ b/solr/solrj/src/test-files/solrj/solr/solr.xml
@@ -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>
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
index 78df30866b9..3d469b0d672 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
@@ -109,7 +109,7 @@ public class CloudSolrServerTest extends AbstractFullDistribZkTestBase {
public CloudSolrServerTest() {
super();
sliceCount = 2;
- shardCount = 4;
+ shardCount = 3;
}
@Override
@@ -236,9 +236,16 @@ public class CloudSolrServerTest extends AbstractFullDistribZkTestBase {
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 AbstractFullDistribZkTestBase {
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 AbstractFullDistribZkTestBase {
}
}
- 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 AbstractFullDistribZkTestBase {
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 {