Support jenkins randomization in integration tests

This commit is contained in:
Robert Muir 2015-08-06 14:48:27 -04:00
parent 8590fa49a6
commit 7414d19d28
9 changed files with 41 additions and 22 deletions

View File

@ -134,7 +134,7 @@
<attribute name="es.transport.tcp.port" default="${integ.transport.port}"/>
<attribute name="es.pidfile" default="${integ.pidfile}"/>
<attribute name="additional.args" default=""/>
<element name="nested.args" optional="true"/>
<attribute name="jvm.args" default="${tests.jvm.argline}"/>
<sequential>
<!-- build args to pass to es -->
@ -154,11 +154,16 @@
<!-- run bin/elasticsearch with args -->
<echo>Starting up external cluster...</echo>
<echo>JAVA=${java.home}</echo>
<echo>ARGS=@{jvm.args}</echo>
<run-script script="@{home}/bin/elasticsearch"
spawn="@{spawn}"
args="${integ.args}">
<nested>
<nested.args/>
<env key="JAVA_HOME" value="${java.home}"/>
<!-- we pass these as gc options, even if they arent, to avoid conflicting gc options -->
<env key="ES_GC_OPTS" value="@{jvm.args}"/>
</nested>
</run-script>
@ -197,11 +202,8 @@
<unzip src="${project.build.directory}/releases/${project.artifactId}-${project.version}.zip" dest="${integ.scratch}"/>
<local name="home"/>
<property name="home" location="${integ.scratch}/${project.artifactId}-${elasticsearch.version}"/>
<startup-elasticsearch spawn="false" home="${home}">
<nested.args>
<env key="JAVA_OPTS" value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"/>
</nested.args>
</startup-elasticsearch>
<startup-elasticsearch spawn="false" home="${home}"
jvm.args="${tests.jvm.argline} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"/>
</target>
<!-- unzip core release artifact, install plugin, then start ES -->

View File

@ -273,7 +273,9 @@
<configuration>
<skip>${skip.integ.tests}</skip>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-deb"/>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-deb">
<property name="tests.jvm.argline" value="${tests.jvm.argline}"/>
</ant>
</target>
</configuration>
</execution>

View File

@ -327,7 +327,9 @@
<configuration>
<skip>${skip.integ.tests}</skip>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-rpm"/>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-rpm">
<property name="tests.jvm.argline" value="${tests.jvm.argline}"/>
</ant>
</target>
</configuration>
</execution>

View File

@ -50,14 +50,16 @@ if NOT "%ES_USE_IPV4%" == "" (
set JAVA_OPTS=%JAVA_OPTS% -Djava.net.preferIPv4Stack=true
)
set JAVA_OPTS=%JAVA_OPTS% -XX:+UseParNewGC
set JAVA_OPTS=%JAVA_OPTS% -XX:+UseConcMarkSweepGC
set JAVA_OPTS=%JAVA_OPTS% -XX:CMSInitiatingOccupancyFraction=75
set JAVA_OPTS=%JAVA_OPTS% -XX:+UseCMSInitiatingOccupancyOnly
REM Add gc options. ES_GC_OPTS is unsupported, for internal testing
if "%ES_GC_OPTS%" == "" (
set ES_GC_OPTS=%ES_GC_OPTS% -XX:+UseParNewGC
set ES_GC_OPTS=%ES_GC_OPTS% -XX:+UseConcMarkSweepGC
set ES_GC_OPTS=%ES_GC_OPTS% -XX:CMSInitiatingOccupancyFraction=75
set ES_GC_OPTS=%ES_GC_OPTS% -XX:+UseCMSInitiatingOccupancyOnly
REM When running under Java 7
REM JAVA_OPTS=%JAVA_OPTS% -XX:+UseCondCardMark
)
set JAVA_OPTS=%JAVA_OPTS% %ES_GC_OPTS
if "%ES_GC_LOG_FILE%" == "" goto nogclog

View File

@ -44,11 +44,15 @@ if [ "x$ES_USE_IPV4" != "x" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
fi
JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC"
JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC"
# Add gc options. ES_GC_OPTS is unsupported, for internal testing
if [ "x$ES_GC_OPTS" = "x" ]; then
ES_GC_OPTS="$ES_GC_OPTS -XX:+UseParNewGC"
ES_GC_OPTS="$ES_GC_OPTS -XX:+UseConcMarkSweepGC"
ES_GC_OPTS="$ES_GC_OPTS -XX:CMSInitiatingOccupancyFraction=75"
ES_GC_OPTS="$ES_GC_OPTS -XX:+UseCMSInitiatingOccupancyOnly"
fi
JAVA_OPTS="$JAVA_OPTS -XX:CMSInitiatingOccupancyFraction=75"
JAVA_OPTS="$JAVA_OPTS -XX:+UseCMSInitiatingOccupancyOnly"
JAVA_OPTS="$JAVA_OPTS $ES_GC_OPTS"
# GC logging options
if [ -n "$ES_GC_LOG_FILE" ]; then

View File

@ -67,7 +67,9 @@
<configuration>
<skip>${skip.integ.tests}</skip>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-tar"/>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-tar">
<property name="tests.jvm.argline" value="${tests.jvm.argline}"/>
</ant>
</target>
</configuration>
</execution>

View File

@ -84,7 +84,9 @@
<configuration>
<skip>${skip.integ.tests}</skip>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-zip"/>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-zip">
<property name="tests.jvm.argline" value="${tests.jvm.argline}"/>
</ant>
</target>
</configuration>
</execution>

View File

@ -311,7 +311,9 @@
<configuration>
<skip>${skip.integ.tests}</skip>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-with-plugin"/>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-with-plugin">
<property name="tests.jvm.argline" value="${tests.jvm.argline}"/>
</ant>
</target>
</configuration>
</execution>

View File

@ -193,6 +193,7 @@
<configuration>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-with-plugins">
<property name="tests.jvm.argline" value="${tests.jvm.argline}"/>
<property name="plugins.dir" value="${plugins.dir}"/>
<property name="expected.plugin.count" value="${expected.plugin.count}"/>
</ant>