From c57a3f3e60b150e68c58e23ea74a5f034d1e9798 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 17 Jun 2020 20:52:13 -0700 Subject: [PATCH] Cleanup jdk repro parameters (#57838) The version of java printed when a test fails currently is passed in from gradle. However, we already know this from java itself, so it is not necessary. This commit changes how the runtime.java repro parameter is found, as well as removes the compiler.java parameter which is no longer relevant. closes #57756 --- .../org/elasticsearch/gradle/ElasticsearchJavaPlugin.java | 2 -- .../test/junit/listeners/ReproduceInfoPrinter.java | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchJavaPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchJavaPlugin.java index 95a2a0ca58c..109dd029e6f 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchJavaPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchJavaPlugin.java @@ -425,8 +425,6 @@ public class ElasticsearchJavaPlugin implements Plugin { // we use 'temp' relative to CWD since this is per JVM and tests are forbidden from writing to CWD nonInputProperties.systemProperty("java.io.tmpdir", test.getWorkingDir().toPath().resolve("temp")); - nonInputProperties.systemProperty("runtime.java", BuildParams.getRuntimeJavaVersion().getMajorVersion()); - // TODO: remove setting logging level via system property test.systemProperty("tests.logger.level", "WARN"); System.getProperties().entrySet().forEach(entry -> { diff --git a/test/framework/src/main/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java b/test/framework/src/main/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java index 7d1b8411c01..1b43cd924c5 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java +++ b/test/framework/src/main/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java @@ -22,6 +22,7 @@ import com.carrotsearch.randomizedtesting.ReproduceErrorMessageBuilder; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.lucene.util.Constants; +import org.elasticsearch.bootstrap.JavaVersion; import org.elasticsearch.common.Strings; import org.elasticsearch.common.SuppressForbidden; import org.elasticsearch.test.ESIntegTestCase; @@ -172,8 +173,7 @@ public class ReproduceInfoPrinter extends RunListener { appendOpt("tests.locale", Locale.getDefault().toLanguageTag()); appendOpt("tests.timezone", TimeZone.getDefault().getID()); appendOpt("tests.distribution", System.getProperty("tests.distribution")); - appendOpt("compiler.java", System.getProperty("compiler.java")); - appendOpt("runtime.java", System.getProperty("runtime.java")); + appendOpt("runtime.java", Integer.toString(JavaVersion.current().getVersion().get(0))); appendOpt(ESTestCase.FIPS_SYSPROP, System.getProperty(ESTestCase.FIPS_SYSPROP)); return this; }