8147847: [TESTBUG] serviceability/tmtools/jstat test ported to JTREG are failing with -XX:+ExplicitGCInvokesConcurrent
authorakulyakh
Mon, 08 Feb 2016 14:50:54 +0300
changeset 35945 f532c5c62540
parent 35944 ea9806c3f58f
child 35946 640eb5784fe3
8147847: [TESTBUG] serviceability/tmtools/jstat test ported to JTREG are failing with -XX:+ExplicitGCInvokesConcurrent Summary: Fixed the test scenarios to eliminate false failures Reviewed-by: jbachorik
hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java
hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java
hotspot/test/serviceability/tmtools/jstat/GcTest01.java
hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java
hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java
--- a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java	Fri Feb 05 18:37:18 2016 +0100
+++ b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java	Mon Feb 08 14:50:54 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
  * displayed with jstat -gccapacity.
  * @library /test/lib/share/classes
  * @library ../share
- * @ignore 8147848
+ * @requires vm.opt.ExplicitGCInvokesConcurrent != true
  * @build common.*
  * @build utils.*
  * @run main/othervm -XX:+UsePerfData GcCapacityTest
--- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java	Fri Feb 05 18:37:18 2016 +0100
+++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java	Mon Feb 08 14:50:54 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
  *          collection time increase.
  * @library /test/lib/share/classes
  * @library ../share
- * @ignore 8147848
+ * @requires vm.opt.ExplicitGCInvokesConcurrent != true
  * @build common.*
  * @build utils.*
  *
--- a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java	Fri Feb 05 18:37:18 2016 +0100
+++ b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java	Mon Feb 08 14:50:54 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
  *          collection time increase.
  * @library /test/lib/share/classes
  * @library ../share
- * @ignore 8147848
+ * @requires vm.opt.ExplicitGCInvokesConcurrent != true
  * @build common.*
  * @build utils.*
  *
--- a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java	Fri Feb 05 18:37:18 2016 +0100
+++ b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java	Mon Feb 08 14:50:54 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
             long edenSize = Pools.getEdenCommittedSize();
             long heapSize = Pools.getHeapCommittedSize();
             float targetPercent = ((float) edenSize) / (heapSize);
-            if ((targetPercent <= 0) || (targetPercent > 1.0)) {
+            if ((targetPercent < 0) || (targetPercent > 1.0)) {
                 throw new RuntimeException("Error in the percent calculation" + " (eden size: " + edenSize + ", heap size: " + heapSize + ", calculated eden percent: " + targetPercent + ")");
             }
             eatHeapMemory(targetPercent);
--- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java	Fri Feb 05 18:37:18 2016 +0100
+++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java	Mon Feb 08 14:50:54 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,10 +77,10 @@
         assertThat(NGC <= NGCMX, "NGC > NGCMX (generation capacity > max generation capacity)");
 
         float S0C = getFloatValue("S0C");
-        assertThat(S0C < NGC, "S0C >= NGC (survivor space 0 capacity >= new generation capacity)");
+        assertThat(S0C <= NGC, "S0C > NGC (survivor space 0 capacity > new generation capacity)");
 
         float S1C = getFloatValue("S1C");
-        assertThat(S1C < NGC, "S1C >= NGC (survivor space 1 capacity >= new generation capacity)");
+        assertThat(S1C <= NGC, "S1C > NGC (survivor space 1 capacity > new generation capacity)");
 
         float EC = getFloatValue("EC");
         assertThat(EC <= NGC, "EC > NGC (eden space capacity > new generation capacity)");