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/03/15 22:16:10 UTC

[lucene-solr] 02/04: SOLR-12923: tweak the randomization in testCreateLargeSimCollections to reduce the max possible totalCores

This is an automated email from the ASF dual-hosted git repository.

hossman pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 0ac45c1668111150040091d043310efef9700179
Author: Chris Hostetter <ho...@apache.org>
AuthorDate: Fri Mar 15 10:43:28 2019 -0700

    SOLR-12923: tweak the randomization in testCreateLargeSimCollections to reduce the max possible totalCores
    
    also decrease the number of iters while increase the cluster shape wait time to reduce the risk of spurious failures on machines under heavy contention w/o making the the test any slower on average
    
    (cherry picked from commit c79aeee5f9a013c280a76a8d6b04bea63f212909)
---
 .../solr/cloud/autoscaling/sim/TestSimLargeCluster.java       | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimLargeCluster.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimLargeCluster.java
index 7a3a163..ed160cf 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimLargeCluster.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimLargeCluster.java
@@ -251,12 +251,13 @@ public class TestSimLargeCluster extends SimSolrCloudTestCase {
   public void testCreateLargeSimCollections() throws Exception {
     SolrClient solrClient = cluster.simGetSolrClient();
 
-    final int numCollections = atLeast(10);
+    final int numCollections = atLeast(5);
     for (int i = 0; i < numCollections; i++) {
+      // wide and shallow, or deep and narrow...
       final int numShards = TestUtil.nextInt(random(), 5, 20);
-      final int nReps = TestUtil.nextInt(random(), 10, 25);
-      final int tReps = TestUtil.nextInt(random(), 10, 25);
-      final int pReps = TestUtil.nextInt(random(), 10, 25);
+      final int nReps = TestUtil.nextInt(random(), 2, 25 - numShards);
+      final int tReps = TestUtil.nextInt(random(), 2, 25 - numShards);
+      final int pReps = TestUtil.nextInt(random(), 2, 25 - numShards);
       final int repsPerShard = (nReps + tReps + pReps);
       final int totalCores = repsPerShard * numShards;
       final int maxShardsPerNode = atLeast(2) + (totalCores / NUM_NODES);
@@ -273,7 +274,7 @@ public class TestSimLargeCluster extends SimSolrCloudTestCase {
       // Since our current goal is to try and find situations where cores are just flat out missing
       // no matter how long we wait, let's be excessive and generous in our timeout.
       // (REMINDER: this uses the cluster's timesource, and ADDREPLICA has a hardcoded delay of 500ms)
-      CloudTestUtils.waitForState(cluster, name, totalCores, TimeUnit.SECONDS,
+      CloudTestUtils.waitForState(cluster, name, 2 * totalCores, TimeUnit.SECONDS,
                                   CloudTestUtils.clusterShape(numShards, repsPerShard, false, true));
       
       final CollectionAdminRequest.Delete delete = CollectionAdminRequest.deleteCollection(name);