Skip to content

Commit

Permalink
Make integ tests always use runtime java (#39732)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rjernst committed Mar 8, 2019
1 parent 89a1f15 commit 35dd524
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) }
Expand Down

0 comments on commit 35dd524

Please sign in to comment.