SOLR-14096: Stopping -Denable.packages=true from leaking to other tests

This commit is contained in:
Ishan Chattopadhyaya 2019-12-16 20:20:07 +05:30
parent 83800c03df
commit ee0b066ab6
2 changed files with 24 additions and 2 deletions

View File

@ -47,6 +47,8 @@ import org.apache.solr.common.util.Utils;
import org.apache.solr.util.LogLevel;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.server.ByteBufferInputStream;
import org.junit.After;
import org.junit.Before;
import static org.apache.solr.common.util.Utils.JAVABINCONSUMER;
import static org.apache.solr.core.TestDynamicLoading.getFileContent;
@ -54,8 +56,17 @@ import static org.apache.solr.core.TestDynamicLoading.getFileContent;
@LogLevel("org.apache.solr.filestore.PackageStoreAPI=DEBUG;org.apache.solr.filestore.DistribPackageStore=DEBUG")
public class TestDistribPackageStore extends SolrCloudTestCase {
public void testPackageStoreManagement() throws Exception {
@Before
public void setup() {
System.setProperty("enable.packages", "true");
}
@After
public void teardown() {
System.clearProperty("enable.packages");
}
public void testPackageStoreManagement() throws Exception {
MiniSolrCloudCluster cluster =
configureCluster(4)
.withJettyConfig(jetty -> jetty.enableV2(true))

View File

@ -54,6 +54,8 @@ import org.apache.solr.filestore.TestDistribPackageStore;
import org.apache.solr.util.LogLevel;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.data.Stat;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.apache.solr.common.cloud.ZkStateReader.SOLR_PKGS_PATH;
@ -67,9 +69,18 @@ import static org.apache.solr.filestore.TestDistribPackageStore.waitForAllNodesH
//@org.apache.lucene.util.LuceneTestCase.AwaitsFix(bugUrl="https://issues.apache.org/jira/browse/SOLR-13822") // leaks files
public class TestPackages extends SolrCloudTestCase {
@Before
public void setup() {
System.setProperty("enable.packages", "true");
}
@After
public void teardown() {
System.clearProperty("enable.packages");
}
@Test
public void testPluginLoading() throws Exception {
System.setProperty("enable.packages", "true");
MiniSolrCloudCluster cluster =
configureCluster(4)
.withJettyConfig(jetty -> jetty.enableV2(true))