8214531: HeapMonitorEventOnOffTest.java test fails with "Statistics should be null to begin with"
authorjcbeyler
Thu, 06 Dec 2018 14:18:39 -0800
changeset 52886 2708a32dc964
parent 52885 db0173cac437
child 52887 0d89f672c62e
8214531: HeapMonitorEventOnOffTest.java test fails with "Statistics should be null to begin with" Summary: Remove the enable sampling and let the underlying method call it Reviewed-by: sspitsyn, phh
test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorEventOnOffTest.java
--- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorEventOnOffTest.java	Thu Dec 06 15:51:19 2018 -0500
+++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorEventOnOffTest.java	Thu Dec 06 14:18:39 2018 -0800
@@ -35,7 +35,6 @@
  */
 public class HeapMonitorEventOnOffTest {
   public static void main(String[] args) {
-    HeapMonitor.enableSamplingEvents();
     HeapMonitor.allocateAndCheckFrames();
 
     // Disabling the notification system should stop events.
@@ -43,8 +42,8 @@
     HeapMonitor.resetEventStorage();
     HeapMonitor.allocateAndCheckFrames(false, false);
 
-    // Enabling the notification system should start events again.
-    HeapMonitor.enableSamplingEvents();
+    // By calling allocateAndCheckFrames(), we enable the notifications and check if allocations
+    // get sampled again.
     HeapMonitor.allocateAndCheckFrames();
   }
 }