From c650d31ef1992f0bc289ab4e8906f0f351ac3041 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 19 Nov 2015 13:06:47 -0800 Subject: [PATCH] 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. --- .../gradle/test/ClusterFormationTasks.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index d49b1ffe0bf..8d01d2f39e2 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -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) { Map esEnv = [ '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 esProps = config.systemProperties.collect { key, value -> "-D${key}=${value}" } for (Map.Entry property : System.properties.entrySet()) { @@ -242,7 +242,7 @@ class ClusterFormationTasks { // gradle task options are not processed until the end of the configuration phase if (config.debug) { 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 @@ -309,10 +309,10 @@ class ClusterFormationTasks { if (ant.properties.containsKey("failed${name}".toString()) || failedMarker.exists()) { if (logger.isInfoEnabled() == false) { // 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) - 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) File startLog = new File(cwd, 'run.log') if (startLog.exists()) {