From ed3a71fa2b69f0818a29fb4fba75caeb9dd7d513 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 14 Apr 2016 10:09:55 -0400 Subject: [PATCH] Fix JvmInfoTests#testUseG1GC to include OpenJDK VMs Since OpenJDK virtual machines have G1 GC but do not have a java.vm.name that contains HotSpot, this test fails on OpenJDK. Instead, the java.vm.name condition should be expanded to include OpenJDK virtual machines. --- .../test/java/org/elasticsearch/monitor/jvm/JvmInfoTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/test/java/org/elasticsearch/monitor/jvm/JvmInfoTests.java b/core/src/test/java/org/elasticsearch/monitor/jvm/JvmInfoTests.java index 7504ae6a34a..82b264ae1d6 100644 --- a/core/src/test/java/org/elasticsearch/monitor/jvm/JvmInfoTests.java +++ b/core/src/test/java/org/elasticsearch/monitor/jvm/JvmInfoTests.java @@ -29,7 +29,7 @@ public class JvmInfoTests extends ESTestCase { // if we are running on HotSpot, and the test JVM was started // with UseG1GC, then JvmInfo should successfully report that // G1GC is enabled - if (Constants.JVM_NAME.contains("HotSpot")) { + if (Constants.JVM_NAME.contains("HotSpot") || Constants.JVM_NAME.contains("OpenJDK")) { assertEquals(Boolean.toString(isG1GCEnabled()), JvmInfo.jvmInfo().useG1GC()); } else { assertEquals("unknown", JvmInfo.jvmInfo().useG1GC());