Skip to content

Apache Lucene open-source search software

LUCENE-1709: force benchmark tests to run sequentially and enable threadsPerProcessor as arg to ant (default to 1)

Shai Erera9992282d5330
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 81645abbcc4..ffa7143da2d 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -478,6 +478,12 @@ Build
* LUCENE-2074: Regenerating StandardTokenizerImpl files now needs
JFlex 1.5 (currently only available on SVN). (Uwe Schindler)
+* LUCENE-1709: Tests are now parallelized by default (except for benchmark). You
+ can force them to run sequentially by passing -Drunsequential=1 on the command
+ line. The number of threads that are spwaned per CPU defaults to '1'. If you
+ wish to change that, you can run the tests with -DthreadsPerProcessor=[num].
+ (Robert Muir, Shai Erera)
+
Test Cases
* LUCENE-2037 Allow Junit4 tests in our envrionment (Erick Erickson
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index 59e4d2a9f62..e4ffd32b7a3 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -54,7 +54,8 @@
<!-- default arguments to pass to JVM executing tests -->
<property name="args" value=""/>
-
+ <property name="threadsPerProcessor" value="1" />
+
<property name="javac.deprecation" value="off"/>
<property name="javac.debug" value="on"/>
<property name="javac.source" value="1.5"/>
@@ -484,7 +485,7 @@
</target>
<target name="junit-parallel" unless="runsequential">
- <parallel threadsPerProcessor="2">
+ <parallel threadsPerProcessor="${threadsPerProcessor}">
<test-macro pattern="A"/>
<test-macro pattern="B"/>
<test-macro pattern="C"/>
diff --git a/lucene/contrib/benchmark/build.xml b/lucene/contrib/benchmark/build.xml
index 14c624cc59b..e39771ee319 100644
--- a/lucene/contrib/benchmark/build.xml
+++ b/lucene/contrib/benchmark/build.xml
@@ -8,6 +8,9 @@
<import file="../contrib-build.xml"/>
<property name="working.dir" location="work"/>
+ <!-- the tests have some parallel problems -->
+ <property name="runsequential" value="true"/>
+
<contrib-uptodate name="highlighter" property="highlighter.uptodate" classpath.property="highlighter.jar"/>
<contrib-uptodate name="icu" property="icu.uptodate" classpath.property="icu.jar"/>
<!-- analyzers common needs a hack for the jar file: -->