mirror of https://github.com/apache/lucene.git
LUCENE-4488: Enable heapdumps for Jenkins builds on supported JVMs
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1400037 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d80c59b48a
commit
5455c64a19
50
build.xml
50
build.xml
|
@ -30,6 +30,8 @@
|
|||
<subant buildpath="lucene" target="test-help" inheritall="false" failonerror="true"/>
|
||||
</target>
|
||||
|
||||
<property name="tests.heap-dump-dir" location="heapdumps"/>
|
||||
|
||||
<target name="precommit" description="Run basic checks before committing"
|
||||
depends="check-svn-working-copy,validate,documentation-lint"/>
|
||||
|
||||
|
@ -218,13 +220,11 @@
|
|||
|
||||
<target name="clean" description="Clean Lucene and Solr build dirs">
|
||||
<delete dir="dist" />
|
||||
<sequential>
|
||||
<subant target="clean" inheritall="false" failonerror="true">
|
||||
<fileset dir="lucene" includes="build.xml" />
|
||||
<fileset dir="solr" includes="build.xml" />
|
||||
</subant>
|
||||
<delete dir="dist" failonerror="false" />
|
||||
</sequential>
|
||||
<delete dir="${tests.heap-dump-dir}" />
|
||||
<subant target="clean" inheritall="false" failonerror="true">
|
||||
<fileset dir="lucene" includes="build.xml" />
|
||||
<fileset dir="solr" includes="build.xml" />
|
||||
</subant>
|
||||
</target>
|
||||
|
||||
<target name="ivy-bootstrap" description="Download and install Ivy in the users ant lib dir">
|
||||
|
@ -309,7 +309,7 @@
|
|||
<param name="run.clover" value="true"/>
|
||||
<!-- must be 1, as clover does not like parallel test runs: -->
|
||||
<param name="tests.jvms" value="1"/>
|
||||
<!-- Also override some other props to be fast, ignoring what's set on command line: -->
|
||||
<!-- Also override some other props to be fast: -->
|
||||
<param name="tests.multiplier" value="1"/>
|
||||
<param name="tests.nightly" value="false"/>
|
||||
<param name="tests.weekly" value="false"/>
|
||||
|
@ -326,8 +326,40 @@
|
|||
<subant buildpath="." antfile="extra-targets.xml" target="-generate-clover-reports" inheritall="false" failonerror="true"/>
|
||||
</target>
|
||||
|
||||
<target name="test-with-heapdumps" depends="-test-with-heapdumps-enabled,-test-with-heapdumps-disabled" description="Runs tests with heap dumps on OOM enabled (if VM supports this)"/>
|
||||
|
||||
<condition property="vm.supports.heapdumps">
|
||||
<or>
|
||||
<contains string="${java.vm.name}" substring="hotspot" casesensitive="false"/>
|
||||
<contains string="${java.vm.name}" substring="openjdk" casesensitive="false"/>
|
||||
<contains string="${java.vm.name}" substring="jrockit" casesensitive="false"/>
|
||||
</or>
|
||||
</condition>
|
||||
|
||||
<target name="-test-with-heapdumps-enabled" if="vm.supports.heapdumps">
|
||||
<echo level="info" message="${java.vm.name}: Enabling heap dumps on OutOfMemoryError to dir '${tests.heap-dump-dir}'."/>
|
||||
<mkdir dir="${tests.heap-dump-dir}"/>
|
||||
<delete includeEmptyDirs="true">
|
||||
<fileset dir="${tests.heap-dump-dir}" includes="**/*"/>
|
||||
</delete>
|
||||
<antcall inheritAll="false" target="test">
|
||||
<param name="tests.heapdump.args" value="-XX:+HeapDumpOnOutOfMemoryError "-XX:HeapDumpPath=${tests.heap-dump-dir}""/>
|
||||
</antcall>
|
||||
<pathconvert property="heapdumps.list" setonempty="false" pathsep="${line.separator}">
|
||||
<fileset dir="${tests.heap-dump-dir}"/>
|
||||
<map from="${tests.heap-dump-dir}${file.separator}" to="* "/>
|
||||
</pathconvert>
|
||||
<fail if="heapdumps.list" message="Some of the tests produced a heap dump, but did not fail. Maybe a suppressed OutOfMemoryError? Dumps created:${line.separator}${heapdumps.list}"/>
|
||||
<delete dir="${tests.heap-dump-dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="-test-with-heapdumps-disabled" unless="vm.supports.heapdumps">
|
||||
<echo level="warning" message="WARN: The used JVM (${java.vm.name}) does not support HPROF heap dumps on OutOfMemoryError."/>
|
||||
<antcall target="test"/>
|
||||
</target>
|
||||
|
||||
<!-- Jenkins tasks -->
|
||||
<target name="jenkins-hourly" depends="clean,test,validate,-jenkins-documentation-lint,jar-checksums,check-svn-working-copy"/>
|
||||
<target name="jenkins-hourly" depends="clean,test-with-heapdumps,validate,-jenkins-documentation-lint,jar-checksums,check-svn-working-copy"/>
|
||||
|
||||
<target name="jenkins-maven-nightly" depends="clean,remove-maven-artifacts,run-maven-build,generate-maven-artifacts,validate-maven-dependencies"/>
|
||||
|
||||
|
|
|
@ -109,6 +109,8 @@
|
|||
</condition>
|
||||
<property name="tests.clover.args" value=""/>
|
||||
|
||||
<property name="tests.heapdump.args" value=""/>
|
||||
|
||||
<property name="tests.tempDir" location="${build.dir}/test"/>
|
||||
|
||||
<property name="tests.cachefile" location="${common.dir}/tools/junit4/cached-timehints.txt" />
|
||||
|
@ -827,6 +829,7 @@
|
|||
|
||||
<!-- JVM arguments and system properties. -->
|
||||
<jvmarg line="${args}"/>
|
||||
<jvmarg line="${tests.heapdump.args}"/>
|
||||
<jvmarg line="${tests.clover.args}"/>
|
||||
|
||||
<!-- set the number of times tests should run -->
|
||||
|
|
Loading…
Reference in New Issue