8269425: 2 jdk/jfr/api/consumer/streaming tests failed to attach

Reviewed-by: mgronlun
This commit is contained in:
Erik Gahlin 2021-12-17 09:49:44 +00:00
parent b9a477bf19
commit fffa73c1ef
3 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, 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
@ -36,7 +36,7 @@ import jdk.jfr.consumer.EventStream;
* @library /test/lib /test/jdk
* @modules jdk.jfr jdk.attach java.base/jdk.internal.misc
*
* @run main/othervm jdk.jfr.api.consumer.streaming.TestJVMCrash
* @run main/othervm -Dsun.tools.attach.attachTimeout=100000 jdk.jfr.api.consumer.streaming.TestJVMCrash
*/
public class TestJVMCrash {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, 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
@ -35,7 +35,7 @@ import jdk.jfr.consumer.EventStream;
* @library /test/lib /test/jdk
* @modules jdk.jfr jdk.attach java.base/jdk.internal.misc
*
* @run main/othervm jdk.jfr.api.consumer.streaming.TestJVMExit
* @run main/othervm -Dsun.tools.attach.attachTimeout=100000 jdk.jfr.api.consumer.streaming.TestJVMExit
*/
public class TestJVMExit {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, 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
@ -51,8 +51,8 @@ public class StreamingUtils {
try {
VirtualMachine vm = VirtualMachine.attach(String.valueOf(process.pid()));
String repo = vm.getSystemProperties().getProperty("jdk.jfr.repository");
vm.detach();
if (repo != null) {
vm.detach();
System.out.println("JFR repository: " + repo);
return Paths.get(repo);
}