You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2011/03/25 03:49:37 UTC
svn commit: r1085241 - in /lucene/dev/trunk/lucene: common-build.xml
src/test-framework/org/apache/lucene/util/LuceneTestCase.java
Author: rmuir
Date: Fri Mar 25 02:49:37 2011
New Revision: 1085241
URL: http://svn.apache.org/viewvc?rev=1085241&view=rev
Log:
configure this from build.xml instead of o.a.solr hack
Modified:
lucene/dev/trunk/lucene/common-build.xml
lucene/dev/trunk/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java
Modified: lucene/dev/trunk/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/common-build.xml?rev=1085241&r1=1085240&r2=1085241&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/common-build.xml (original)
+++ lucene/dev/trunk/lucene/common-build.xml Fri Mar 25 02:49:37 2011
@@ -511,6 +511,8 @@
<sysproperty key="tests.seed" value="${tests.seed}"/>
<!-- set the Version that tests should run against -->
<sysproperty key="tests.luceneMatchVersion" value="${tests.luceneMatchVersion}"/>
+ <!-- for lucene we can be strict, and we don't want false fails even across methods -->
+ <sysproperty key="tests.cleanthreads" value="perMethod"/>
<!-- logging config file -->
<sysproperty key="java.util.logging.config.file" value="${tests.loggingfile}"/>
<!-- set whether or not nightly tests should run -->
Modified: lucene/dev/trunk/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java?rev=1085241&r1=1085240&r2=1085241&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/trunk/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java Fri Mar 25 02:49:37 2011
@@ -148,6 +148,8 @@ public abstract class LuceneTestCase ext
public static final boolean TEST_NIGHTLY = Boolean.parseBoolean(System.getProperty("tests.nightly", "false"));
/** the line file used by LineFileDocs */
public static final String TEST_LINE_DOCS_FILE = System.getProperty("tests.linedocsfile", "europarl.lines.txt.gz");
+ /** whether or not to clean threads between test invocations: "false", "perMethod", "perClass" */
+ public static final String TEST_CLEAN_THREADS = System.getProperty("tests.cleanthreads", "perClass");
private static final Pattern codecWithParam = Pattern.compile("(.*)\\(\\s*(\\d+)\\s*\\)");
@@ -342,10 +344,12 @@ public abstract class LuceneTestCase ext
@AfterClass
public static void afterClassLuceneTestCaseJ4() {
- int rogueThreads = threadCleanup("test class");
- if (rogueThreads > 0) {
- // TODO: fail here once the leaks are fixed.
- System.err.println("RESOURCE LEAK: test class left " + rogueThreads + " thread(s) running");
+ if (! "false".equals(TEST_CLEAN_THREADS)) {
+ int rogueThreads = threadCleanup("test class");
+ if (rogueThreads > 0) {
+ // TODO: fail here once the leaks are fixed.
+ System.err.println("RESOURCE LEAK: test class left " + rogueThreads + " thread(s) running");
+ }
}
String codecDescription;
CodecProvider cp = CodecProvider.getDefault();
@@ -490,7 +494,7 @@ public abstract class LuceneTestCase ext
assertTrue("ensure your setUp() calls super.setUp()!!!", setup);
setup = false;
BooleanQuery.setMaxClauseCount(savedBoolMaxClauseCount);
- if (!getClass().getName().startsWith("org.apache.solr")) {
+ if ("perMethod".equals(TEST_CLEAN_THREADS)) {
int rogueThreads = threadCleanup("test method: '" + getName() + "'");
if (rogueThreads > 0) {
System.err.println("RESOURCE LEAK: test method: '" + getName()