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
--- 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();
}
}