You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dp...@apache.org on 2016/05/05 23:58:52 UTC
lucene-solr:branch_6x: SOLR-8996: Greatly decreases the probability
of a RandomStream test failure from 1 in 5! to 1 in 1000!
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6x 8b56f67ad -> 06a675ce2
SOLR-8996: Greatly decreases the probability of a RandomStream test failure from 1 in 5! to 1 in 1000!
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/06a675ce
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/06a675ce
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/06a675ce
Branch: refs/heads/branch_6x
Commit: 06a675ce2c57e6fc1adf18d88528d578e79a3463
Parents: 8b56f67
Author: Dennis Gove <dp...@gmail.com>
Authored: Thu May 5 19:50:47 2016 -0400
Committer: Dennis Gove <dp...@gmail.com>
Committed: Thu May 5 19:54:24 2016 -0400
----------------------------------------------------------------------
.../solrj/io/stream/StreamExpressionTest.java | 21 ++++++++++----------
1 file changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a675ce/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index f0b7b7b..60187e4 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -482,13 +482,12 @@ public class StreamExpressionTest extends SolrCloudTestCase {
@Test
public void testRandomStream() throws Exception {
- new UpdateRequest()
- .add(id, "0", "a_s", "hello0", "a_i", "0", "a_f", "0")
- .add(id, "2", "a_s", "hello2", "a_i", "2", "a_f", "0")
- .add(id, "3", "a_s", "hello3", "a_i", "3", "a_f", "3")
- .add(id, "4", "a_s", "hello4", "a_i", "4", "a_f", "4")
- .add(id, "1", "a_s", "hello1", "a_i", "1", "a_f", "1")
- .commit(cluster.getSolrClient(), COLLECTION);
+ UpdateRequest update = new UpdateRequest();
+ for(int idx = 0; idx < 1000; ++idx){
+ String idxString = new Integer(idx).toString();
+ update.add(id,idxString, "a_s", "hello" + idxString, "a_i", idxString, "a_f", idxString);
+ }
+ update.commit(cluster.getSolrClient(), COLLECTION);
StreamExpression expression;
TupleStream stream;
@@ -503,17 +502,17 @@ public class StreamExpressionTest extends SolrCloudTestCase {
try {
context.setSolrClientCache(cache);
- expression = StreamExpressionParser.parse("random(" + COLLECTION + ", q=\"*:*\", rows=\"10\", fl=\"id, a_i\")");
+ expression = StreamExpressionParser.parse("random(" + COLLECTION + ", q=\"*:*\", rows=\"1000\", fl=\"id, a_i\")");
stream = factory.constructStream(expression);
stream.setStreamContext(context);
List<Tuple> tuples1 = getTuples(stream);
- assert (tuples1.size() == 5);
+ assert (tuples1.size() == 1000);
- expression = StreamExpressionParser.parse("random(" + COLLECTION + ", q=\"*:*\", rows=\"10\", fl=\"id, a_i\")");
+ expression = StreamExpressionParser.parse("random(" + COLLECTION + ", q=\"*:*\", rows=\"1000\", fl=\"id, a_i\")");
stream = factory.constructStream(expression);
stream.setStreamContext(context);
List<Tuple> tuples2 = getTuples(stream);
- assert (tuples2.size() == 5);
+ assert (tuples2.size() == 1000);
boolean different = false;
for (int i = 0; i < tuples1.size(); i++) {