From 4fc917c25005d1f88fe43069fe623e243bd022c3 Mon Sep 17 00:00:00 2001 From: Johannes Bechberger Date: Tue, 9 Sep 2025 10:15:53 +0000 Subject: [PATCH] 8366486: Test jdk/jfr/event/profiling/TestCPUTimeSampleMultipleRecordings.java is timing out Reviewed-by: jbachorik --- .../profiling/TestCPUTimeSampleMultipleRecordings.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/jdk/jdk/jfr/event/profiling/TestCPUTimeSampleMultipleRecordings.java b/test/jdk/jdk/jfr/event/profiling/TestCPUTimeSampleMultipleRecordings.java index 976d08f1250..efc4da28021 100644 --- a/test/jdk/jdk/jfr/event/profiling/TestCPUTimeSampleMultipleRecordings.java +++ b/test/jdk/jdk/jfr/event/profiling/TestCPUTimeSampleMultipleRecordings.java @@ -39,20 +39,15 @@ import jdk.test.lib.jfr.EventNames; * @run main/timeout=480 jdk.jfr.event.profiling.TestCPUTimeSampleMultipleRecordings */ public class TestCPUTimeSampleMultipleRecordings { - - static String nativeEvent = EventNames.CPUTimeSample; - static volatile boolean alive = true; public static void main(String[] args) throws Exception { Thread t = new Thread(TestCPUTimeSampleMultipleRecordings::nativeMethod); - t.setDaemon(true); t.start(); for (int i = 0; i < 2; i++) { try (RecordingStream rs = new RecordingStream()) { - rs.enable(nativeEvent).with("throttle", "1ms"); - rs.onEvent(nativeEvent, e -> { - alive = false; + rs.enable(EventNames.CPUTimeSample).with("throttle", "1ms"); + rs.onEvent(EventNames.CPUTimeSample, e -> { rs.close(); }); @@ -60,6 +55,7 @@ public class TestCPUTimeSampleMultipleRecordings { } } alive = false; + t.join(); } public static void nativeMethod() {