From 35dd52461f7ed5857d70491e9e089bd0e8e4df13 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 6 Mar 2019 10:11:34 -0800 Subject: [PATCH] Make integ tests always use runtime java (#39732) This commit ensures cluster formation always uses runtime java, never attempting to use the bundled jdk, since the integ test zip does not contain it. --- .../elasticsearch/gradle/test/ClusterFormationTasks.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 49f8706ab9c..057d4b7d0cb 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -682,7 +682,8 @@ class ClusterFormationTasks { return project.tasks.create(name: name, type: LoggedExec, dependsOn: setup) { Exec exec -> exec.workingDir node.cwd // TODO: this must change to 7.0.0 after bundling java has been backported - if (project.isRuntimeJavaHomeSet || node.nodeVersion.before(Version.fromString("8.0.0"))) { + if (project.isRuntimeJavaHomeSet || node.nodeVersion.before(Version.fromString("8.0.0")) || + node.config.distribution == 'integ-test-zip') { exec.environment.put('JAVA_HOME', project.runtimeJavaHome) } else { // force JAVA_HOME to *not* be set @@ -707,7 +708,8 @@ class ClusterFormationTasks { ant.exec(executable: node.executable, spawn: node.config.daemonize, newenvironment: true, dir: node.cwd, taskname: 'elasticsearch') { node.env.each { key, value -> env(key: key, value: value) } - if (project.isRuntimeJavaHomeSet || node.nodeVersion.before(Version.fromString("8.0.0"))) { + if (project.isRuntimeJavaHomeSet || node.nodeVersion.before(Version.fromString("8.0.0")) || + node.config.distribution == 'integ-test-zip') { env(key: 'JAVA_HOME', value: project.runtimeJavaHome) } node.args.each { arg(value: it) }