Commit b83766e 1 parent 7efe160 commit b83766e Copy full SHA for b83766e
File tree 1 file changed +17
-0
lines changed
test/jdk/jdk/jfr/api/consumer/streaming
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 34
34
* @requires vm.hasJFR
35
35
* @library /test/lib /test/jdk
36
36
* @modules jdk.jfr jdk.attach java.base/jdk.internal.misc
37
+ * @build jdk.jfr.api.consumer.streaming.TestProcess
37
38
*
38
39
* @run main/othervm -Dsun.tools.attach.attachTimeout=100000 jdk.jfr.api.consumer.streaming.TestJVMExit
39
40
*/
40
41
public class TestJVMExit {
41
42
42
43
public static void main (String ... args ) throws Exception {
44
+ while (true ) {
45
+ try {
46
+ testExit ();
47
+ return ;
48
+ } catch (RuntimeException e ) {
49
+ String message = String .valueOf (e .getMessage ());
50
+ // If the test application crashes during startup, retry.
51
+ if (!message .contains ("is no longer alive" )) {
52
+ throw e ;
53
+ }
54
+ System .out .println ("Application not alive when trying to get repository. Retrying." );
55
+ }
56
+ }
57
+ }
58
+
59
+ private static void testExit () throws Exception {
43
60
try (TestProcess process = new TestProcess ("exit-application" )) {
44
61
AtomicInteger eventCounter = new AtomicInteger ();
45
62
try (EventStream es = EventStream .openRepository (process .getRepository ())) {
You can’t perform that action at this time.
0 commit comments