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 2015/07/24 19:40:36 UTC
svn commit: r1692554 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/core/
solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java
Author: hossman
Date: Fri Jul 24 17:40:36 2015
New Revision: 1692554
URL: http://svn.apache.org/r1692554
Log:
SOLR-7804: Fix test bug where it was randomly generating 2 identical facet.pivot params w/o realizing it (merge r1692552)
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/solr/ (props changed)
lucene/dev/branches/branch_5x/solr/core/ (props changed)
lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java
Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java?rev=1692554&r1=1692553&r2=1692554&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java Fri Jul 24 17:40:36 2015
@@ -39,6 +39,7 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -165,11 +166,15 @@ public class TestCloudPivotFacet extends
}
ModifiableSolrParams pivotP = params(FACET,"true");
- pivotP.add(FACET_PIVOT, buildPivotParamValue(buildRandomPivot(fieldNames)));
+
+ // put our FACET_PIVOT params in a set in case we just happen to pick the same one twice
+ LinkedHashSet<String> pivotParamValues = new LinkedHashSet<String>();
+ pivotParamValues.add(buildPivotParamValue(buildRandomPivot(fieldNames)));
if (random().nextBoolean()) {
- pivotP.add(FACET_PIVOT, buildPivotParamValue(buildRandomPivot(fieldNames)));
+ pivotParamValues.add(buildPivotParamValue(buildRandomPivot(fieldNames)));
}
+ pivotP.set(FACET_PIVOT, pivotParamValues.toArray(new String[pivotParamValues.size()]));
// keep limit low - lots of unique values, and lots of depth in pivots
pivotP.add(FACET_LIMIT, ""+TestUtil.nextInt(random(),1,17));