mirror of https://github.com/apache/lucene.git
SOLR-2860: remove broken code for tracking solrindexwriter open/close pairs -- redundent because of SOLR-2279
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1196292 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f94d21b022
commit
9fd6d2a120
|
@ -41,7 +41,6 @@ import org.apache.solr.schema.IndexSchema;
|
|||
import org.apache.solr.schema.SchemaField;
|
||||
import org.apache.solr.search.SolrIndexSearcher;
|
||||
import org.apache.solr.servlet.DirectSolrConnection;
|
||||
import org.apache.solr.update.SolrIndexWriter;
|
||||
import org.apache.solr.util.TestHarness;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -65,7 +64,6 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
|
|||
@BeforeClass
|
||||
public static void beforeClassSolrTestCase() throws Exception {
|
||||
startTrackingSearchers();
|
||||
startTrackingWriters();
|
||||
ignoreException("ignore_exception");
|
||||
}
|
||||
|
||||
|
@ -74,7 +72,6 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
|
|||
deleteCore();
|
||||
resetExceptionIgnores();
|
||||
endTrackingSearchers();
|
||||
endTrackingWriters();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -130,28 +127,6 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
static long numWriterOpens;
|
||||
static long numWriterCloses;
|
||||
public static void startTrackingWriters() {
|
||||
numOpens = SolrIndexWriter.numOpens.get();
|
||||
numCloses = SolrIndexWriter.numCloses.get();
|
||||
}
|
||||
|
||||
public static void endTrackingWriters() {
|
||||
long endNumOpens = SolrIndexWriter.numOpens.get();
|
||||
long endNumCloses = SolrIndexWriter.numCloses.get();
|
||||
|
||||
SolrIndexWriter.numOpens.getAndSet(0);
|
||||
SolrIndexWriter.numCloses.getAndSet(0);
|
||||
|
||||
if (endNumOpens-numOpens != endNumCloses-numCloses) {
|
||||
String msg = "ERROR: SolrIndexWriter opens=" + (endNumOpens-numWriterOpens) + " closes=" + (endNumCloses-numWriterCloses);
|
||||
log.error(msg);
|
||||
testsFailed = true;
|
||||
fail(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/** Causes an exception matching the regex pattern to not be logged. */
|
||||
public static void ignoreException(String pattern) {
|
||||
if (SolrException.ignorePatterns == null)
|
||||
|
|
|
@ -97,13 +97,11 @@ public abstract class AbstractSolrTestCase extends LuceneTestCase {
|
|||
@BeforeClass
|
||||
public static void beforeClassAbstractSolrTestCase() throws Exception {
|
||||
SolrTestCaseJ4.startTrackingSearchers();
|
||||
SolrTestCaseJ4.startTrackingWriters();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void afterClassAbstractSolrTestCase() throws Exception {
|
||||
SolrTestCaseJ4.endTrackingSearchers();
|
||||
SolrTestCaseJ4.endTrackingWriters();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue