Configure TMP for test nodes on Windows (#39959)
This breaks on windows where TMP dir default to C:\Windows and startup fails with a permission error. I tried to create a tmp dir and pass in `TMP` env, but it lead to a class not found error, and since testclusers is already independent of the calling environment I stopped there.
This commit is contained in:
parent
7a7658707a
commit
9b8b47114e
|
@ -719,6 +719,13 @@ class ClusterFormationTasks {
|
|||
env(key: 'JAVA_HOME', value: project.runtimeJavaHome)
|
||||
}
|
||||
node.args.each { arg(value: it) }
|
||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||
// Having no TMP on Windows defaults to C:\Windows and permission errors
|
||||
// Since we configure ant to run with a new environment above, we need to set this to a dir we have access to
|
||||
File tmpDir = new File(node.baseDir, "tmp")
|
||||
tmpDir.mkdirs()
|
||||
env(key: "TMP", value: tmpDir.absolutePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ source "`dirname "$0"`"/elasticsearch-env
|
|||
|
||||
ES_JVM_OPTIONS="$ES_PATH_CONF"/jvm.options
|
||||
JVM_OPTIONS=`"$JAVA" -cp "$ES_CLASSPATH" org.elasticsearch.tools.launchers.JvmOptionsParser "$ES_JVM_OPTIONS"`
|
||||
ES_JAVA_OPTS="${JVM_OPTIONS//\$\{ES_TMPDIR\}/$ES_TMPDIR} $ES_JAVA_OPTS"
|
||||
ES_JAVA_OPTS="${JVM_OPTIONS//\"\$\{ES_TMPDIR\}\"/$ES_TMPDIR} $ES_JAVA_OPTS"
|
||||
|
||||
cd "$ES_HOME"
|
||||
# manual parsing to find out, if process should be detached
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
|
||||
-Djava.io.tmpdir=${ES_TMPDIR}
|
||||
-Djava.io.tmpdir="${ES_TMPDIR}"
|
||||
|
||||
## heap dumps
|
||||
|
||||
|
|
Loading…
Reference in New Issue