mirror of https://github.com/apache/lucene.git
SOLR-14000: clean up more static field leaks in tests
On windows, these objects can't be inspected due to security restrictions. So the test runner fails the tests since it does not know how big the leak is.
This commit is contained in:
parent
16f793915e
commit
165529767b
|
@ -91,6 +91,8 @@ public class SolrStandaloneScraperTest extends RestTestBase {
|
||||||
jetty.stop();
|
jetty.stop();
|
||||||
jetty = null;
|
jetty = null;
|
||||||
}
|
}
|
||||||
|
solrScraper = null;
|
||||||
|
solrClient = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -204,6 +204,7 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {
|
||||||
zkControllerMock = null;
|
zkControllerMock = null;
|
||||||
cloudDataProviderMock = null;
|
cloudDataProviderMock = null;
|
||||||
clusterStateProviderMock = null;
|
clusterStateProviderMock = null;
|
||||||
|
stateManagerMock = null;;
|
||||||
cloudManagerMock = null;
|
cloudManagerMock = null;
|
||||||
distribStateManagerMock = null;
|
distribStateManagerMock = null;
|
||||||
coreContainerMock = null;
|
coreContainerMock = null;
|
||||||
|
|
|
@ -315,6 +315,8 @@ public class OverseerTest extends SolrTestCaseJ4 {
|
||||||
if (null != server) {
|
if (null != server) {
|
||||||
server.shutdown();
|
server.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
|
|
|
@ -48,6 +48,7 @@ import org.apache.solr.common.util.TimeSource;
|
||||||
import org.apache.solr.util.LogLevel;
|
import org.apache.solr.util.LogLevel;
|
||||||
import org.apache.solr.util.TimeOut;
|
import org.apache.solr.util.TimeOut;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -92,6 +93,11 @@ public class TestWithCollection extends SolrCloudTestCase {
|
||||||
shutdownCluster();
|
shutdownCluster();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
cloudManager = null;
|
||||||
|
}
|
||||||
|
|
||||||
private void deleteChildrenRecursively(String path) throws Exception {
|
private void deleteChildrenRecursively(String path) throws Exception {
|
||||||
cloudManager.getDistribStateManager().removeRecursively(path, true, false);
|
cloudManager.getDistribStateManager().removeRecursively(path, true, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@ import org.apache.solr.common.util.Utils;
|
||||||
import org.apache.solr.core.SolrResourceLoader;
|
import org.apache.solr.core.SolrResourceLoader;
|
||||||
import org.apache.solr.util.LogLevel;
|
import org.apache.solr.util.LogLevel;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -168,6 +169,11 @@ public class ComputePlanActionTest extends SolrCloudTestCase {
|
||||||
state.forEachCollection(coll -> log.debug("* Collection " + coll.getName() + " state: " + coll));
|
state.forEachCollection(coll -> log.debug("* Collection " + coll.getName() + " state: " + coll));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
cloudManager = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@LuceneTestCase.AwaitsFix(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028")
|
@LuceneTestCase.AwaitsFix(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028")
|
||||||
public void testNodeLost() throws Exception {
|
public void testNodeLost() throws Exception {
|
||||||
|
|
|
@ -41,6 +41,7 @@ import org.apache.solr.util.LogLevel;
|
||||||
import org.apache.solr.util.TimeOut;
|
import org.apache.solr.util.TimeOut;
|
||||||
import org.apache.zookeeper.data.Stat;
|
import org.apache.zookeeper.data.Stat;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -68,6 +69,11 @@ public class NodeAddedTriggerIntegrationTest extends SolrCloudTestCase {
|
||||||
shutdownCluster();
|
shutdownCluster();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
cloudManager = null;
|
||||||
|
}
|
||||||
|
|
||||||
private static CountDownLatch getTriggerFiredLatch() {
|
private static CountDownLatch getTriggerFiredLatch() {
|
||||||
return triggerFiredLatch;
|
return triggerFiredLatch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ import org.apache.solr.util.LogLevel;
|
||||||
import org.apache.solr.util.TimeOut;
|
import org.apache.solr.util.TimeOut;
|
||||||
import org.apache.zookeeper.data.Stat;
|
import org.apache.zookeeper.data.Stat;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -116,6 +117,11 @@ public class NodeLostTriggerIntegrationTest extends SolrCloudTestCase {
|
||||||
shutdownCluster();
|
shutdownCluster();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
cloudManager = null;
|
||||||
|
}
|
||||||
|
|
||||||
private void deleteChildrenRecursively(String path) throws Exception {
|
private void deleteChildrenRecursively(String path) throws Exception {
|
||||||
cloudManager.getDistribStateManager().removeRecursively(path, true, false);
|
cloudManager.getDistribStateManager().removeRecursively(path, true, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ import org.apache.solr.common.util.Utils;
|
||||||
import org.apache.solr.core.SolrResourceLoader;
|
import org.apache.solr.core.SolrResourceLoader;
|
||||||
import org.apache.solr.util.LogLevel;
|
import org.apache.solr.util.LogLevel;
|
||||||
import org.apache.zookeeper.data.Stat;
|
import org.apache.zookeeper.data.Stat;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -90,6 +91,11 @@ public class TriggerIntegrationTest extends SolrCloudTestCase {
|
||||||
CloudTestUtils.suspendTrigger(cluster.getOpenOverseer().getSolrCloudManager(), ".scheduled_maintenance");
|
CloudTestUtils.suspendTrigger(cluster.getOpenOverseer().getSolrCloudManager(), ".scheduled_maintenance");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
cloudManager = null;
|
||||||
|
}
|
||||||
|
|
||||||
private static CountDownLatch getTriggerFiredLatch() {
|
private static CountDownLatch getTriggerFiredLatch() {
|
||||||
return triggerFiredLatch;
|
return triggerFiredLatch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,7 @@ public class TestSimClusterStateProvider extends SolrCloudTestCase {
|
||||||
if (simulated && cloudManager != null) {
|
if (simulated && cloudManager != null) {
|
||||||
cloudManager.close();
|
cloudManager.close();
|
||||||
}
|
}
|
||||||
|
cloudManager = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void init() throws Exception {
|
private static void init() throws Exception {
|
||||||
|
|
|
@ -51,6 +51,7 @@ import org.apache.solr.common.cloud.Replica;
|
||||||
import org.apache.solr.common.params.CollectionAdminParams;
|
import org.apache.solr.common.params.CollectionAdminParams;
|
||||||
import org.apache.solr.common.util.TimeSource;
|
import org.apache.solr.common.util.TimeSource;
|
||||||
import org.apache.solr.common.util.Utils;
|
import org.apache.solr.common.util.Utils;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -82,6 +83,11 @@ public class TestSnapshotCloudManager extends SolrCloudTestCase {
|
||||||
.getZkController().getSolrCloudManager();
|
.getZkController().getSolrCloudManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
realManager = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSnapshots() throws Exception {
|
public void testSnapshots() throws Exception {
|
||||||
SnapshotCloudManager snapshotCloudManager = new SnapshotCloudManager(realManager, null);
|
SnapshotCloudManager snapshotCloudManager = new SnapshotCloudManager(realManager, null);
|
||||||
|
|
|
@ -100,6 +100,7 @@ public class TestJmxIntegration extends SolrTestCaseJ4 {
|
||||||
MBeanServerFactory.releaseMBeanServer(newMbeanServer);
|
MBeanServerFactory.releaseMBeanServer(newMbeanServer);
|
||||||
}
|
}
|
||||||
mbeanServer = null;
|
mbeanServer = null;
|
||||||
|
newMbeanServer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
|
|
@ -111,6 +111,11 @@ public class MetricsHistoryHandlerTest extends SolrCloudTestCase {
|
||||||
if (simulated) {
|
if (simulated) {
|
||||||
cloudManager.close();
|
cloudManager.close();
|
||||||
}
|
}
|
||||||
|
handler = null;
|
||||||
|
metricsHandler = null;
|
||||||
|
cloudManager = null;
|
||||||
|
metricManager = null;
|
||||||
|
solrClient = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -42,6 +42,7 @@ import org.apache.solr.common.params.ModifiableSolrParams;
|
||||||
import org.apache.solr.common.params.SolrParams;
|
import org.apache.solr.common.params.SolrParams;
|
||||||
import org.apache.solr.common.util.ContentStream;
|
import org.apache.solr.common.util.ContentStream;
|
||||||
import org.apache.solr.common.util.ContentStreamBase;
|
import org.apache.solr.common.util.ContentStreamBase;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
|
@ -62,6 +63,11 @@ public class EmbeddedSolrNoSerializeTest extends SolrTestCaseJ4 {
|
||||||
//we don't need to close the EmbeddedSolrServer because SolrTestCaseJ4 closes the core
|
//we don't need to close the EmbeddedSolrServer because SolrTestCaseJ4 closes the core
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
solrServer = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
|
@ -40,6 +40,7 @@ import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
|
||||||
import org.apache.solr.common.SolrException;
|
import org.apache.solr.common.SolrException;
|
||||||
import org.apache.solr.request.SolrQueryRequest;
|
import org.apache.solr.request.SolrQueryRequest;
|
||||||
import org.apache.solr.response.SolrQueryResponse;
|
import org.apache.solr.response.SolrQueryResponse;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
|
@ -59,6 +60,11 @@ public class XmlInterpolationTest extends TaggerTestCase {
|
||||||
initCore("solrconfig-tagger.xml", "schema-tagger.xml");
|
initCore("solrconfig-tagger.xml", "schema-tagger.xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
xmlDocBuilder = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
|
@ -36,6 +36,7 @@ import org.apache.solr.cloud.SolrCloudTestCase;
|
||||||
import org.apache.solr.common.SolrDocument;
|
import org.apache.solr.common.SolrDocument;
|
||||||
import org.apache.solr.common.SolrInputDocument;
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
import org.apache.solr.common.cloud.ZkStateReader;
|
import org.apache.solr.common.cloud.ZkStateReader;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -120,6 +121,11 @@ public class TestCloudNestedDocsSort extends SolrCloudTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
client = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() throws SolrServerException, IOException {
|
public void test() throws SolrServerException, IOException {
|
||||||
final boolean asc = random().nextBoolean();
|
final boolean asc = random().nextBoolean();
|
||||||
|
|
|
@ -40,6 +40,7 @@ import org.apache.solr.response.SolrQueryResponse;
|
||||||
import org.apache.solr.update.UpdateCommand;
|
import org.apache.solr.update.UpdateCommand;
|
||||||
import org.apache.solr.util.LogLevel;
|
import org.apache.solr.util.LogLevel;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -85,6 +86,11 @@ public class CategoryRoutedAliasUpdateProcessorTest extends RoutedAliasUpdatePro
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
solrClient = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Slow
|
@Slow
|
||||||
public void testNonEnglish() throws Exception {
|
public void testNonEnglish() throws Exception {
|
||||||
|
|
|
@ -85,6 +85,7 @@ public class DimensionalRoutedAliasUpdateProcessorTest extends RoutedAliasUpdate
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void finish() throws Exception {
|
public static void finish() throws Exception {
|
||||||
IOUtils.close(solrClient);
|
IOUtils.close(solrClient);
|
||||||
|
solrClient = null;
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
public void testTimeCat() throws Exception {
|
public void testTimeCat() throws Exception {
|
||||||
|
|
|
@ -71,6 +71,7 @@ import org.apache.solr.handler.admin.CollectionsHandler;
|
||||||
import org.apache.solr.handler.admin.ConfigSetsHandler;
|
import org.apache.solr.handler.admin.ConfigSetsHandler;
|
||||||
import org.apache.solr.handler.admin.CoreAdminHandler;
|
import org.apache.solr.handler.admin.CoreAdminHandler;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -134,6 +135,12 @@ public class CloudHttp2SolrClientTest extends SolrCloudTestCase {
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
httpBasedCloudSolrClient = null;
|
||||||
|
zkBasedCloudSolrClient = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Randomly return the cluster's ZK based CSC, or HttpClusterProvider based CSC.
|
* Randomly return the cluster's ZK based CSC, or HttpClusterProvider based CSC.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -72,6 +72,7 @@ import org.apache.solr.handler.admin.CollectionsHandler;
|
||||||
import org.apache.solr.handler.admin.ConfigSetsHandler;
|
import org.apache.solr.handler.admin.ConfigSetsHandler;
|
||||||
import org.apache.solr.handler.admin.CoreAdminHandler;
|
import org.apache.solr.handler.admin.CoreAdminHandler;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -124,6 +125,11 @@ public class CloudSolrClientTest extends SolrCloudTestCase {
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void cleanUpAfterClass() throws Exception {
|
||||||
|
httpBasedCloudSolrClient = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Randomly return the cluster's ZK based CSC, or HttpClusterProvider based CSC.
|
* Randomly return the cluster's ZK based CSC, or HttpClusterProvider based CSC.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue