Build: Improve integ test startup behavior

As part of the refactoring to allow --debug-jvm with gradle run, the way
java options are passed for integ tests was changed. However, we need to
make sure the jvm argline passed goes to ES_GC_OPTS because this
allows overriding things like which garbage collector we run, which we
do for testing from jenkins. This change adds back ES_GC_OPTS.
This commit is contained in:
Ryan Ernst 2015-11-19 13:06:47 -08:00
parent 83db1c2930
commit c650d31ef1
1 changed files with 4 additions and 4 deletions

View File

@ -213,7 +213,7 @@ class ClusterFormationTasks {
static Task configureStartTask(String name, Project project, Task setup, File cwd, ClusterConfiguration config, String clusterName, File pidFile, File home) { static Task configureStartTask(String name, Project project, Task setup, File cwd, ClusterConfiguration config, String clusterName, File pidFile, File home) {
Map esEnv = [ Map esEnv = [
'JAVA_HOME' : project.javaHome, 'JAVA_HOME' : project.javaHome,
'JAVA_OPTS': config.jvmArgs 'ES_GC_OPTS': config.jvmArgs // we pass these with the undocumented gc opts so the argline can set gc, etc
] ]
List<String> esProps = config.systemProperties.collect { key, value -> "-D${key}=${value}" } List<String> esProps = config.systemProperties.collect { key, value -> "-D${key}=${value}" }
for (Map.Entry<String, String> property : System.properties.entrySet()) { for (Map.Entry<String, String> property : System.properties.entrySet()) {
@ -242,7 +242,7 @@ class ClusterFormationTasks {
// gradle task options are not processed until the end of the configuration phase // gradle task options are not processed until the end of the configuration phase
if (config.debug) { if (config.debug) {
println 'Running elasticsearch in debug mode, suspending until connected on port 8000' println 'Running elasticsearch in debug mode, suspending until connected on port 8000'
esEnv['JAVA_OPTS'] += ' -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000' esEnv['JAVA_OPTS'] = '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000'
} }
// Due to how ant exec works with the spawn option, we lose all stdout/stderr from the // Due to how ant exec works with the spawn option, we lose all stdout/stderr from the
@ -309,10 +309,10 @@ class ClusterFormationTasks {
if (ant.properties.containsKey("failed${name}".toString()) || failedMarker.exists()) { if (ant.properties.containsKey("failed${name}".toString()) || failedMarker.exists()) {
if (logger.isInfoEnabled() == false) { if (logger.isInfoEnabled() == false) {
// We already log the command at info level. No need to do it twice. // We already log the command at info level. No need to do it twice.
logger.error(esCommandString) esCommandString.eachLine { line -> logger.error(line) }
} }
// the waitfor failed, so dump any output we got (may be empty if info logging, but that is ok) // the waitfor failed, so dump any output we got (may be empty if info logging, but that is ok)
logger.error(buffer.toString('UTF-8')) buffer.toString('UTF-8').eachLine { line -> logger.error(line) }
// also dump the log file for the startup script (which will include ES logging output to stdout) // also dump the log file for the startup script (which will include ES logging output to stdout)
File startLog = new File(cwd, 'run.log') File startLog = new File(cwd, 'run.log')
if (startLog.exists()) { if (startLog.exists()) {