Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Fix test to use solr.disable.shardsWhitelist=true rather then trying to whitelist the set of servers

Chris Hostetter3fe4d0a30aab
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
index 460a9360de5..b70c8ddd7b2 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
@@ -58,6 +58,7 @@ public class TestJsonFacets extends SolrTestCaseHS {
@BeforeClass
public static void beforeTests() throws Exception {
+ systemSetPropertySolrDisableShardsWhitelist("true");
JSONTestUtil.failRepeatedKeys = true;
origTableSize = FacetFieldProcessorByHashDV.MAXIMUM_STARTING_TABLE_SIZE;
@@ -74,35 +75,16 @@ public class TestJsonFacets extends SolrTestCaseHS {
}
/**
- * Start all servers for cluster, initialize shards whitelist and then restart
+ * Start all servers for cluster if they don't already exist
*/
public static void initServers() throws Exception {
if (servers == null) {
servers = new SolrInstances(3, "solrconfig-tlog.xml", "schema_latest.xml");
- // Set the shards whitelist to all shards plus the fake one used for tolerant test
- System.setProperty(SOLR_TESTS_SHARDS_WHITELIST, servers.getWhitelistString() + ",http://[ff01::114]:33332");
- systemSetPropertySolrDisableShardsWhitelist("false");
- restartServers();
}
}
- /**
- * Restart all configured servers, i.e. configuration will be re-read
- */
- public static void restartServers() {
- servers.slist.forEach(s -> {
- try {
- s.stop();
- s.start();
- } catch (Exception e) {
- fail("Exception during server restart: " + e.getMessage());
- }
- });
- }
-
@AfterClass
public static void afterTests() throws Exception {
- System.clearProperty(SOLR_TESTS_SHARDS_WHITELIST);
systemClearPropertySolrDisableShardsWhitelist();
JSONTestUtil.failRepeatedKeys = false;
FacetFieldProcessorByHashDV.MAXIMUM_STARTING_TABLE_SIZE=origTableSize;