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/10/08 19:26:04 UTC

[lucene-solr] branch reference_impl_dev updated: Un-ignore some configset related tests

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


The following commit(s) were added to refs/heads/reference_impl_dev by this push:
     new 6b05b88  Un-ignore some configset related tests
6b05b88 is described below

commit 6b05b88e4365c35f7c54517e6ae453461b240a19
Author: Timothy Potter <th...@gmail.com>
AuthorDate: Thu Oct 8 12:42:24 2020 -0600

    Un-ignore some configset related tests
---
 .../src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java   | 3 +++
 solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java     | 4 ----
 .../src/test/org/apache/solr/handler/PingRequestHandlerTest.java    | 6 ++----
 .../src/test/org/apache/solr/handler/admin/DaemonStreamApiTest.java | 2 +-
 .../test/org/apache/solr/handler/component/SearchHandlerTest.java   | 6 ++----
 .../apache/solr/metrics/reporters/solr/SolrCloudReportersTest.java  | 6 ++----
 solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java | 6 +++---
 .../src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java        | 2 +-
 8 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java
index 5c21215..abc75aa 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java
@@ -179,6 +179,9 @@ public class ConfigSetsHandler extends RequestHandlerBase implements PermissionN
     while ((zipEntry = zis.getNextEntry()) != null) {
       String filePathInZk = configPathInZk + "/" + zipEntry.getName();
       if (zipEntry.isDirectory()) {
+        if (filePathInZk.endsWith("/")) {
+          filePathInZk = filePathInZk.substring(0, filePathInZk.length()-1);
+        }
         zkClient.mkdir(filePathInZk);
       } else {
         createZkNodeIfNotExistsAndSetData(zkClient, filePathInZk,
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
index d698ab2..09bb9e6 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
@@ -100,7 +100,6 @@ import static org.junit.matchers.JUnitMatchers.containsString;
 /**
  * Simple ConfigSets API tests on user errors and simple success cases.
  */
-//@Ignore // nocommit thread leaks
 public class TestConfigSetsAPI extends SolrTestCaseJ4 {
 
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -124,7 +123,6 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
   }
 
   @Test
-  @Ignore // nocommit debug
   public void testCreateErrors() throws Exception {
     final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
     final SolrClient solrClient = getHttpSolrClient(baseUrl);
@@ -320,7 +318,6 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
   }
 
   @Test
-  @Ignore // nocommit debug
   public void testUploadDisabled() throws Exception {
     SolrZkClient zkClient = zkClient();
     for (boolean enabled : new boolean[]{true, false}) {
@@ -336,7 +333,6 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
   }
 
   @Test
-  @Ignore // nocommit debug
   public void testUpload() throws Exception {
     String suffix = "-untrusted";
     uploadConfigSetWithAssertions("regular", suffix, null, null);
diff --git a/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java
index 0885a6a..c768615 100644
--- a/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java
@@ -24,7 +24,6 @@ import org.apache.commons.io.FileUtils;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.SolrPing;
 import org.apache.solr.client.solrj.response.SolrPingResponse;
@@ -35,9 +34,7 @@ import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.response.SolrQueryResponse;
 import org.junit.Before;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 
-@Ignore // nocommit debug flakey - I seem to remember fixing an issue with this before, but not the detail...
 public class PingRequestHandlerTest extends SolrTestCaseJ4 {
   protected int NUM_SERVERS = 5;
   protected int NUM_SHARDS = 2;
@@ -186,7 +183,8 @@ public class PingRequestHandlerTest extends SolrTestCaseJ4 {
       // create collection
       String collectionName = "testSolrCloudCollection";
       String configName = "solrCloudCollectionConfig";
-      miniCluster.uploadConfigSet(SolrTestCaseJ4.TEST_PATH().resolve("collection1").resolve("conf"), configName);
+      miniCluster.uploadConfigSet(configset("cloud-minimal"), configName);
+
       CollectionAdminRequest.createCollection(collectionName, configName, NUM_SHARDS, REPLICATION_FACTOR)
           .process(miniCluster.getSolrClient());
 
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/DaemonStreamApiTest.java b/solr/core/src/test/org/apache/solr/handler/admin/DaemonStreamApiTest.java
index 0258216..74f7be3 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/DaemonStreamApiTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/DaemonStreamApiTest.java
@@ -43,7 +43,7 @@ import org.junit.Ignore;
 import org.junit.Test;
 
 @ThreadLeakLingering(linger = 2000) // allow a small linger for daemon streams to stop
-@Ignore // nocommit - need to fix the driver and this test again
+//@Ignore // nocommit - need to fix the driver and this test again
 public class DaemonStreamApiTest extends SolrTestCaseJ4 {
 
   private MiniSolrCloudCluster cluster;
diff --git a/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
index b44a962..6061ac9 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.solr.handler.component;
 
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
@@ -25,7 +24,6 @@ import java.util.List;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
 import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.QueryRequest;
@@ -41,7 +39,7 @@ import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 
-@Ignore // nocommit debugo
+@Ignore // nocommit, TJP: this code is closing client objects it doesn't own, so test may be testing unsupported behavior in ref branch?
 public class SearchHandlerTest extends SolrTestCaseJ4 
 {
   @BeforeClass
@@ -229,7 +227,7 @@ public class SearchHandlerTest extends SolrTestCaseJ4
       // create collection
       String collectionName = "testRequireZkConnectedDistribCollection";
       String configName = collectionName + "Config";
-      miniCluster.uploadConfigSet(SolrTestCaseJ4.TEST_PATH().resolve("collection1/conf"), configName);
+      miniCluster.uploadConfigSet(TEST_PATH().resolve("collection1").resolve("conf"), configName);
 
       CollectionAdminRequest.createCollection(collectionName, configName, 2, 1)
           .process(miniCluster.getSolrClient());
diff --git a/solr/core/src/test/org/apache/solr/metrics/reporters/solr/SolrCloudReportersTest.java b/solr/core/src/test/org/apache/solr/metrics/reporters/solr/SolrCloudReportersTest.java
index 8a3061a..5c34bd6 100644
--- a/solr/core/src/test/org/apache/solr/metrics/reporters/solr/SolrCloudReportersTest.java
+++ b/solr/core/src/test/org/apache/solr/metrics/reporters/solr/SolrCloudReportersTest.java
@@ -58,12 +58,10 @@ public class SolrCloudReportersTest extends SolrCloudTestCase {
   @Ignore // nocommit remove silly sleep
   public void testExplicitConfiguration() throws Exception {
     String solrXml = IOUtils.toString(SolrCloudReportersTest.class.getResourceAsStream("/solr/solr-solrreporter.xml"), "UTF-8");
-    configureCluster(2)
-        .withSolrXml(solrXml).configure();
-    cluster.uploadConfigSet(Paths.get(TEST_PATH().toString(), "configsets", "minimal", "conf"), "test");
+    configureCluster(2).withSolrXml(solrXml).addConfig("test", configset("cloud-minimal")).configure();
 
     CollectionAdminRequest.createCollection("test_collection", "test", 2, 2)
-        .setMaxShardsPerNode(4)
+        .setMaxShardsPerNode(2)
         .process(cluster.getSolrClient());
     cluster.waitForActiveCollection("test_collection", 2, 4);
     
diff --git a/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java b/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java
index fd4a00c..90c45b4 100644
--- a/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java
+++ b/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java
@@ -38,7 +38,6 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Ignore // nocommit - does not find its conf files on disk
 public class TestDistribIDF extends SolrTestCaseJ4 {
 
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -59,8 +58,8 @@ public class TestDistribIDF extends SolrTestCaseJ4 {
     System.setProperty("solr.test.sys.prop1", "propone");
     System.setProperty("solr.test.sys.prop2", "proptwo");
     solrCluster.getZkClient().mkdirs("/solr/configs");
-    solrCluster.uploadConfigSet(TEST_PATH().resolve("/solr/collection1/conf"), "conf1");
-    solrCluster.uploadConfigSet(configset("/solr/configset-2"), "conf2");
+    solrCluster.uploadConfigSet(TEST_PATH().resolve("collection1").resolve("conf"), "conf1");
+    solrCluster.uploadConfigSet(configset("configset-2"), "conf2");
   }
 
   @Override
@@ -73,6 +72,7 @@ public class TestDistribIDF extends SolrTestCaseJ4 {
   }
 
   @Test
+  @Ignore // nocommit ~ fails due to query result mismatch
   public void testSimpleQuery() throws Exception {
     //3 shards. 3rd shard won't have any data.
     createCollection("onecollection", "conf1", ImplicitDocRouter.NAME);
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java b/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
index 5c7d863..d85b0ec 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
@@ -587,7 +587,7 @@ public class MiniSolrCloudCluster {
 
   public void uploadConfigSet(Path configDir, String configName)
           throws IOException, KeeperException, InterruptedException {
-    ZkConfigManager manager = new ZkConfigManager(zkServer.getZkClient(), "");
+    ZkConfigManager manager = zkStateReader.getConfigManager();
     manager.uploadConfigDir(configDir, configName);
   }