Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-15656: Crush and pin ZK NIO config for tests. (#337)

Mark Robert Miller0298111971cb
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 532b2fd28a3..7691c6ba9ad 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
@@ -1237,7 +1237,7 @@ public class TestConfigSetsAPI extends SolrCloudTestCase {
* {@link ExternalPaths#DEFAULT_CONFIGSET}
*
* @see SolrDispatchFilter#SOLR_DEFAULT_CONFDIR_ATTRIBUTE
- * @see #setDefaultConfigDirSysPropIfNotSet
+ * @see #beforeSolrTestCase
* @see ConfigSetService#getDefaultConfigDirPath
*/
@Test
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
index d0e754a687e..d9101e620e5 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
@@ -92,7 +92,7 @@ public class SolrTestCase extends LuceneTestCase {
* @see SolrDispatchFilter#SOLR_DEFAULT_CONFDIR_ATTRIBUTE
*/
@BeforeClass
- public static void setDefaultConfigDirSysPropIfNotSet() {
+ public static void beforeSolrTestCase() {
final String existingValue = System.getProperty(SolrDispatchFilter.SOLR_DEFAULT_CONFDIR_ATTRIBUTE);
if (null != existingValue) {
log.info("Test env includes configset dir system property '{}'='{}'", SolrDispatchFilter.SOLR_DEFAULT_CONFDIR_ATTRIBUTE, existingValue);
@@ -110,6 +110,14 @@ public class SolrTestCase extends LuceneTestCase {
"for tests to run properly",
SolrDispatchFilter.SOLR_DEFAULT_CONFDIR_ATTRIBUTE, ExternalPaths.DEFAULT_CONFIGSET);
}
+
+ if (!TEST_NIGHTLY) {
+ System.setProperty("zookeeper.nio.numSelectorThreads", "2");
+ System.setProperty("zookeeper.nio.numWorkerThreads", "3");
+ System.setProperty("zookeeper.commitProcessor.numWorkerThreads", "2");
+ System.setProperty("zookeeper.forceSync", "no");
+ System.setProperty("zookeeper.nio.shutdownTimeout", "100");
+ }
}
/**