|
|
@@ -1,5 +1,5 @@ |
|
|
/* |
|
|
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
|
|
* Copyright (c) 2018, 2020, 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 |
|
@@ -68,11 +68,25 @@ |
|
|
|
|
|
public static void main(String[] args) throws Throwable { |
|
|
for (int i = 0; i < subTests.length; ++i) { |
|
|
if (subTests[i].isApplicable()) { |
|
|
runSubtest(i); |
|
|
} else { |
|
|
int attempts = subTests[i].attempts(); |
|
|
if (attempts == 0) { |
|
|
System.out.println("Skipping non-applicable test: " + i); |
|
|
} |
|
|
for (int j = 0; j < attempts -1; j++) { |
|
|
try { |
|
|
runSubtest(i); |
|
|
return; |
|
|
} catch (Exception e) { |
|
|
System.out.println("Failed: " + e.getMessage()); |
|
|
System.out.println(); |
|
|
System.out.println("Retry " + i + 1); |
|
|
} catch (OutOfMemoryError | StackOverflowError e) { |
|
|
System.out.println("Error"); |
|
|
// Can happen when parsing corrupt file. Abort test. |
|
|
return; |
|
|
} |
|
|
} |
|
|
runSubtest(i); |
|
|
} |
|
|
} |
|
|
|
|
@@ -115,8 +129,8 @@ public static void main(String[] args) throws Exception { |
|
|
} |
|
|
|
|
|
private interface ShutdownEventSubTest { |
|
|
default boolean isApplicable() { |
|
|
return true; |
|
|
default int attempts() { |
|
|
return 1; |
|
|
} |
|
|
void runTest(); |
|
|
void verifyEvents(RecordedEvent event, int exitCode); |
|
@@ -174,6 +188,11 @@ public void verifyEvents(RecordedEvent event, int exitCode) { |
|
|
// see 8219082 for details (running the crashed VM with -Xint would solve the issue too) |
|
|
//validateStackTrace(event.getStackTrace()); |
|
|
} |
|
|
|
|
|
@Override |
|
|
public int attempts() { |
|
|
return 3; |
|
|
} |
|
|
} |
|
|
|
|
|
private static class TestUnhandledException implements ShutdownEventSubTest { |
|
@@ -207,14 +226,14 @@ public void verifyEvents(RecordedEvent event, int exitCode) { |
|
|
private final String signalName; |
|
|
|
|
|
@Override |
|
|
public boolean isApplicable() { |
|
|
public int attempts() { |
|
|
if (Platform.isWindows()) { |
|
|
return false; |
|
|
return 0; |
|
|
} |
|
|
if (signalName.equals("HUP") && Platform.isSolaris()) { |
|
|
return false; |
|
|
return 0; |
|
|
} |
|
|
return true; |
|
|
return 1; |
|
|
} |
|
|
|
|
|
public TestSig(String signalName) { |
|
|