mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-15 18:33:41 +00:00
8366486: Test jdk/jfr/event/profiling/TestCPUTimeSampleMultipleRecordings.java is timing out
Reviewed-by: jbachorik
This commit is contained in:
parent
f51e442b0e
commit
4fc917c250
@ -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() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user