You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by th...@apache.org on 2020/09/10 22:05:15 UTC

[lucene-solr] branch reference_impl_dev updated (54455ac -> 36db553)

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

thelabdude pushed a change to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


    from 54455ac  Switch to using ZkClusterStateProvider with MockZkStateReader
     new 7586086  Bind WireMock to loopback IP address only
     new 36db553  Re-enable some passing stream tests

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../solr/client/solrj/io/stream/CommitStream.java  |  5 +++-
 .../solrj/impl/BaseSolrClientWireMockTest.java     |  2 +-
 .../solrj/io/stream/StreamDecoratorTest.java       | 35 +++++-----------------
 .../solrj/io/stream/StreamExpressionTest.java      |  1 -
 .../solr/client/solrj/io/stream/StreamingTest.java |  2 +-
 5 files changed, 13 insertions(+), 32 deletions(-)


[lucene-solr] 01/02: Bind WireMock to loopback IP address only

Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 75860861cfc8978d0c2e664df189f1c399b5cee4
Author: Timothy Potter <th...@gmail.com>
AuthorDate: Thu Sep 10 16:04:27 2020 -0600

    Bind WireMock to loopback IP address only
---
 .../org/apache/solr/client/solrj/impl/BaseSolrClientWireMockTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BaseSolrClientWireMockTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BaseSolrClientWireMockTest.java
index 0874927..3626a52 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BaseSolrClientWireMockTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BaseSolrClientWireMockTest.java
@@ -123,7 +123,7 @@ public abstract class BaseSolrClientWireMockTest extends SolrTestCase {
     qtp.start();
 
     log.info("@BeforeClass: Initializing WireMock ...");
-    mockSolr = new WireMockServer(options().dynamicPort().httpServerFactory(new JettyHttp2ServerFactory()).enableBrowserProxying(false));
+    mockSolr = new WireMockServer(options().bindAddress("127.0.0.1").dynamicPort().httpServerFactory(new JettyHttp2ServerFactory()).enableBrowserProxying(false));
     mockSolr.start();
     log.info("Mock Solr is running at url: {}", mockSolr.baseUrl());
     configureFor("http", "localhost", mockSolr.port());


[lucene-solr] 02/02: Re-enable some passing stream tests

Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 36db553d425d78fb9c31f435685c0d5cf4c170d5
Author: Timothy Potter <th...@gmail.com>
AuthorDate: Thu Sep 10 16:04:53 2020 -0600

    Re-enable some passing stream tests
---
 .../solr/client/solrj/io/stream/CommitStream.java  |  5 +++-
 .../solrj/io/stream/StreamDecoratorTest.java       | 35 +++++-----------------
 .../solrj/io/stream/StreamExpressionTest.java      |  1 -
 .../solr/client/solrj/io/stream/StreamingTest.java |  2 +-
 4 files changed, 12 insertions(+), 31 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CommitStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CommitStream.java
index 9b1c19c..e50a20c 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CommitStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CommitStream.java
@@ -107,7 +107,10 @@ public class CommitStream extends TupleStream implements Expressible {
   @Override
   public void open() throws IOException {
     tupleSource.open();
-    clientCache = new SolrClientCache(zkHost);
+    if (clientCache == null) {
+      clientCache = new SolrClientCache(zkHost);
+      closeClientCache = true;
+    }
     docsSinceCommit = 0;
   }
   
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.java
index 6790679..b7a5e0b 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.java
@@ -70,7 +70,6 @@ import org.junit.After;
 import org.junit.Assume;
 import org.junit.Before;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 @Slow
@@ -2620,10 +2619,10 @@ public class StreamDecoratorTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Ignore // nocommit ~ failing because of straggler updates not getting fully committed
   public void testParallelUpdateStream() throws Exception {
 
-    CollectionAdminRequest.createCollection("parallelDestinationCollection", "conf", 2, 1).process(cluster.getSolrClient());
+    final String collectionId = "parallelUpdateDestCollection";
+    CollectionAdminRequest.createCollection(collectionId, "conf", 2, 1).process(cluster.getSolrClient());
 
     new UpdateRequest()
         .add(id, "0", "a_s", "hello0", "a_i", "0", "a_f", "0", "s_multi", "aaaa", "s_multi", "bbbb", "i_multi", "4", "i_multi", "7")
@@ -2640,18 +2639,18 @@ public class StreamDecoratorTest extends SolrCloudTestCase {
     String zkHost = cluster.getZkServer().getZkAddress();
     StreamFactory factory = new StreamFactory()
       .withCollectionZkHost("collection1", cluster.getZkServer().getZkAddress())
-      .withCollectionZkHost("parallelDestinationCollection", cluster.getZkServer().getZkAddress())
+      .withCollectionZkHost(collectionId, cluster.getZkServer().getZkAddress())
       .withFunctionName("search", CloudSolrStream.class)
       .withFunctionName("update", UpdateStream.class)
       .withFunctionName("parallel", ParallelStream.class);
 
     try {
       //Copy all docs to destinationCollection
-      String updateExpression = "update(parallelDestinationCollection, batchSize=2, search(collection1, q=*:*, fl=\"id,a_s,a_i,a_f,s_multi,i_multi\", sort=\"a_f asc, a_i asc\", partitionKeys=\"a_f\", qt=\"/export\"))";
+      String updateExpression = "update("+collectionId+", batchSize=2, search(collection1, q=*:*, fl=\"id,a_s,a_i,a_f,s_multi,i_multi\", sort=\"a_f asc, a_i asc\", partitionKeys=\"a_f\", qt=\"/export\"))";
       TupleStream parallelUpdateStream = factory.constructStream("parallel(collection1, " + updateExpression + ", workers=\"2\", zkHost=\"" + zkHost + "\", sort=\"batchNumber asc\")");
       parallelUpdateStream.setStreamContext(streamContext);
       List<Tuple> tuples = getTuples(parallelUpdateStream);
-      cluster.getSolrClient().commit("parallelDestinationCollection");
+      cluster.getSolrClient().commit(collectionId);
 
       //Ensure that all UpdateStream tuples indicate the correct number of copied/indexed docs
       long count = 0;
@@ -2663,7 +2662,7 @@ public class StreamDecoratorTest extends SolrCloudTestCase {
       assert (count == 5);
 
       //Ensure that destinationCollection actually has the new docs.
-      expression = StreamExpressionParser.parse("search(parallelDestinationCollection, q=*:*, fl=\"id,a_s,a_i,a_f,s_multi,i_multi\", sort=\"a_i asc\")");
+      expression = StreamExpressionParser.parse("search("+collectionId+", q=*:*, fl=\"id,a_s,a_i,a_f,s_multi,i_multi\", sort=\"a_i asc\")");
       stream = new CloudSolrStream(expression, factory);
       stream.setStreamContext(streamContext);
       tuples = getTuples(stream);
@@ -2710,7 +2709,7 @@ public class StreamDecoratorTest extends SolrCloudTestCase {
       assertList(tuple.getLongs("i_multi"), Long.parseLong("4444"), Long.parseLong("7777"));
       stream.close();
     } finally {
-      CollectionAdminRequest.deleteCollection("parallelDestinationCollection").process(cluster.getSolrClient());
+      CollectionAdminRequest.deleteCollection(collectionId).process(cluster.getSolrClient());
     }
   }
 
@@ -2888,7 +2887,6 @@ public class StreamDecoratorTest extends SolrCloudTestCase {
   }
 
   @Test
-  //@Ignore // nocommit ~ TJP
   public void testParallelTerminatingDaemonUpdateStream() throws Exception {
     Assume.assumeTrue(!useAlias);
 
@@ -3071,7 +3069,6 @@ public class StreamDecoratorTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Ignore
   public void testCommitStream() throws Exception {
 
     CollectionAdminRequest.createCollection("destinationCollection", "conf", 2, 1).process(cluster.getSolrClient());
@@ -3163,7 +3160,6 @@ public class StreamDecoratorTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Ignore
   public void testParallelCommitStream() throws Exception {
 
     CollectionAdminRequest.createCollection("parallelDestinationCollection", "conf", 2, 1).process(cluster.getSolrClient());
@@ -3695,7 +3691,6 @@ public class StreamDecoratorTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Ignore // nocommit can be slow, can hang - perhaps try back to root shared exec and add the per thread execs await method?
   public void testExecutorStream() throws Exception {
     CollectionAdminRequest.createCollection("workQueue", "conf", 2, 1).processAndWait(cluster.getSolrClient(), DEFAULT_TIMEOUT);
     CollectionAdminRequest.createCollection("mainCorpus", "conf", 2, 1).processAndWait( cluster.getSolrClient(), DEFAULT_TIMEOUT);
@@ -3736,14 +3731,6 @@ public class StreamDecoratorTest extends SolrCloudTestCase {
     //Destination collection should now contain all the records in the main corpus.
     cluster.getSolrClient().commit("destination");
 
-    // TODO: the commit doesn't seem to catch all docs, but a second commit works ...
-    // some internal buffering maybe?
-    long numFound = cluster.getSolrClient().query("destination", new SolrQuery("*:*").setRows(0).setFields("id")).getResults().getNumFound();
-    if (numFound < numDocs) {
-      Thread.sleep(100);
-      cluster.getSolrClient().commit("destination");
-    }
-
     paramsLoc = new ModifiableSolrParams();
     paramsLoc.set("expr", "search(destination, q=\"*:*\", fl=\"id, body_t, field_i\", rows=1000, sort=\"field_i asc\")");
     paramsLoc.set("qt","/stream");
@@ -3809,14 +3796,6 @@ public class StreamDecoratorTest extends SolrCloudTestCase {
     //Destination collection should now contain all the records in the main corpus.
     cluster.getSolrClient().commit("destination1");
 
-    // TODO: the commit doesn't seem to catch all docs, but a second commit works ...
-    // some internal buffering maybe?
-    long numFound = cluster.getSolrClient().query("destination1", new SolrQuery("*:*").setRows(0).setFields("id")).getResults().getNumFound();
-    if (numFound < cnt) {
-      Thread.sleep(100);
-      cluster.getSolrClient().commit("destination1");
-    }
-
     paramsLoc = new ModifiableSolrParams();
     paramsLoc.set("expr", "search(destination1, q=\"*:*\", fl=\"id, body_t, field_i\", rows=1000, sort=\"field_i asc\")");
     paramsLoc.set("qt", "/stream");
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 6190102c..2f0024f 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
@@ -2947,7 +2947,6 @@ public class StreamExpressionTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Ignore // nocommit debug
   public void testBasicTextLogitStream() throws Exception {
     Assume.assumeTrue(!useAlias);
 
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java
index 052453e..9b75efd 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java
@@ -1739,7 +1739,7 @@ public void testParallelRankStream() throws Exception {
   }
 
   @Test
-  @Ignore // nocommit - i believe this is big perf issue in the daemon that sometimes materializes
+  @Nightly
   public void testDaemonTopicStream() throws Exception {
     Assume.assumeTrue(!useAlias);