You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2019/01/31 17:51:13 UTC
[lucene-solr] branch branch_7x updated: reduce number of
nodes/shards used in TriLevelCompositeIdRoutingTest to prevent (incredibly
frequent) OOM in nightly
This is an automated email from the ASF dual-hosted git repository.
hossman pushed a commit to branch branch_7x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/branch_7x by this push:
new 4ddb32a reduce number of nodes/shards used in TriLevelCompositeIdRoutingTest to prevent (incredibly frequent) OOM in nightly
4ddb32a is described below
commit 4ddb32ac4330a2c6d87a9c1a1d405c14156f5f6b
Author: Chris Hostetter <ho...@apache.org>
AuthorDate: Thu Jan 31 10:45:12 2019 -0700
reduce number of nodes/shards used in TriLevelCompositeIdRoutingTest to prevent (incredibly frequent) OOM in nightly
(cherry picked from commit 806744b0f1563c5145c494976f2d8800050a1ab6)
---
.../solr/cloud/TriLevelCompositeIdRoutingTest.java | 29 +++++++++++++---------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java b/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java
index b78a765..05a0ab9 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java
@@ -16,7 +16,7 @@
*/
package org.apache.solr.cloud;
-import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.lucene.util.TestUtil;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument;
import org.junit.BeforeClass;
@@ -29,15 +29,13 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
-
-@Slow
public class TriLevelCompositeIdRoutingTest extends ShardRoutingTest {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
- int NUM_APPS = 5;
- int NUM_USERS = 10;
- int NUM_DOCS = 100;
+ final int NUM_APPS;
+ final int NUM_USERS;
+ final int NUM_DOCS;
@BeforeClass
@@ -52,12 +50,18 @@ public class TriLevelCompositeIdRoutingTest extends ShardRoutingTest {
public TriLevelCompositeIdRoutingTest() {
schemaString = "schema15.xml"; // we need a string id
- sliceCount = TEST_NIGHTLY ? 12 : 2; // a lot of slices for more ranges and buckets
- fixShardCount(TEST_NIGHTLY ? 24 : 3);
+
+
+ sliceCount = TestUtil.nextInt(random(), 1, (TEST_NIGHTLY ? 5 : 3)); // this is the number of *SHARDS*
+ int replicationFactor = rarely() ? 2 : 1; // replication is not the focus of this test
+ fixShardCount(replicationFactor * sliceCount); // total num cores, one per node
+
+ NUM_APPS = atLeast(5);
+ NUM_USERS = atLeast(10);
+ NUM_DOCS = atLeast(100);
}
@Test
- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018
public void test() throws Exception {
boolean testFinished = false;
try {
@@ -68,6 +72,8 @@ public class TriLevelCompositeIdRoutingTest extends ShardRoutingTest {
waitForRecoveriesToFinish(true);
doTriLevelHashingTest();
+ del("*:*");
+ commit();
doTriLevelHashingTestWithBitMask();
testFinished = true;
@@ -98,7 +104,7 @@ public class TriLevelCompositeIdRoutingTest extends ShardRoutingTest {
for (int i = 1; i <= sliceCount; i++) {
- Set<String> ids = doQueryGetUniqueIdKeys("q", "*:*", "shards", "shard" + i);
+ Set<String> ids = doQueryGetUniqueIdKeys("q", "*:*", "rows", ""+NUM_DOCS, "shards", "shard" + i);
for (String id : ids) {
assertFalse("Found the same route key [" + id + "] in 2 shards.", idMap.containsKey(id));
idMap.put(getKey(id), i);
@@ -112,7 +118,6 @@ public class TriLevelCompositeIdRoutingTest extends ShardRoutingTest {
log.info("### STARTING doTriLevelHashingTestWithBitMask");
// for now, we know how ranges will be distributed to shards.
// may have to look it up in clusterstate if that assumption changes.
- del("*:*");
for (int i = 0; i < NUM_DOCS; i++) {
int appId = r.nextInt(NUM_APPS) + 1;
@@ -130,7 +135,7 @@ public class TriLevelCompositeIdRoutingTest extends ShardRoutingTest {
for (int i = 1; i <= sliceCount; i++) {
- Set<String> ids = doQueryGetUniqueIdKeys("q", "*:*", "shards", "shard" + i);
+ Set<String> ids = doQueryGetUniqueIdKeys("q", "*:*", "rows", ""+NUM_DOCS, "shards", "shard" + i);
for (String id : ids) {
assertFalse("Found the same route key [" + id + "] in 2 shards.", idMap.containsKey(id));
idMap.put(getKey(id), i);