Apache Lucene open-source search software
LUCENE-5881: Add "beasting" of tests: repeats the whole "test" Ant target N times with "ant beast -Dbeast.iters=N"
Uwe Schindlera5462846287e
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex c25af037f72..84e8be930c1 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -237,14 +237,18 @@ Bug Fixeswould be exceeded, instead of silently creating an unusableindex. (Mike McCandless)-* LUCENE-5869: Added restriction to positive values for maxExpansions in FuzzyQuery.- (Ryan Ernst)+* LUCENE-5869: Added restriction to positive values for maxExpansions in+ FuzzyQuery. (Ryan Ernst)Test Framework* LUCENE-5786: Unflushed/ truncated events file (hung testing subprocess).(Dawid Weiss)+* LUCENE-5881: Add "beasting" of tests: repeats the whole "test" Ant target+ N times with "ant beast -Dbeast.iters=N". (Uwe Schindler, Robert Muir,+ Ryan Ernst, Dawid Weiss)+Build* LUCENE-5770: Upgrade to JFlex 1.6, which has direct support fordiff --git a/lucene/common-build.xml b/lucene/common-build.xmlindex b2e7fc4e188..685729c6804 100644--- a/lucene/common-build.xml+++ b/lucene/common-build.xml@@ -1147,7 +1147,7 @@</target><target name="test-help" description="Help on 'ant test' syntax.">- <echo>+ <echo taskname="help">## Test case filtering. --------------------------------------------#@@ -1202,6 +1202,15 @@ ant test -Dtests.iters=N -Dtests.maxfailures=M -Dtestcase=...# in parallel.ant test -Dtests.dups=N ...+# Test beasting: Repeats every suite with same seed per class+# (N times in parallel) and each test inside (M times). The whole+# run is repeated (beasting) P times in a loop, with a different+# master seed. You can combine beasting with any other parameter,+# just replace "test" with "beast" and give -Dbeast.iters=P+# (P >> 1).+ant test -Dtests.dups=N -Dtests.iters=M -Dbeast.iters=P \+ -Dtestcase=ClassName beast+## Test groups. ----------------------------------------------------#@@ -1289,8 +1298,8 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites<!-- note: order here is important, the taskdef depends on test-frameworkjars so we just order it after compile-test to ensure that -->- <target name="test" depends="clover,compile-test,install-junit4-taskdef,validate,-init-totals,-test,-check-totals" description="Runs unit tests">- </target>+ <target name="test" depends="clover,compile-test,install-junit4-taskdef,validate,-init-totals,-test,-check-totals" description="Runs unit tests"/>+ <target name="beast" depends="clover,compile-test,install-junit4-taskdef,validate,-init-totals,-beast,-check-totals" description="Runs unit tests in a loop (-Dbeast.iters=n)"/><!-- Run the actual tests (must be wrapped with -init-totals, -check-totals) --><target name="-test">@@ -1298,6 +1307,22 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites<test-macro threadNum="${tests.jvms.override}" /></target>+ <!-- Beast the actual tests (must be wrapped with -init-totals, -check-totals) -->+ <target name="-beast" depends="resolve-groovy">+ <groovy taskname="beaster"><![CDATA[+ int iters = (properties['beast.iters'] ?: '1') as int;+ def antcall = project.createTask('antcall');+ antcall.target = '-test';+ antcall.inheritAll = true;+ antcall.inheritRefs = true;+ (1..iters).each { i ->+ task.log('Beast round: ' + i);+ antcall.execute();+ };+ task.log('Beasting finished.');+ ]]></groovy>+ </target>+<target name="-check-totals" if="tests.totals.toplevel" depends="resolve-groovy"><!-- We are concluding a test pass at the outermost level. Sum up all executed tests. --><groovy><![CDATA[@@ -1315,7 +1340,7 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites}// Interesting but let's keep the build output quiet.- // project.log("Grand total of all executed tests (including sub-modules): " + total);+ // task.log("Grand total of all executed tests (including sub-modules): " + total);]]></groovy></target>