8326121: vmTestbase/gc/g1/unloading/tests/unloading_keepRef_rootClass_inMemoryCompilation_keep_cl failed with Full gc happened. Test was useless.

Reviewed-by: tschatzl, ayang
This commit is contained in:
Ivan Walulya 2024-05-30 08:32:15 +00:00
parent 286cc163fd
commit 2b4a4b7bd8
2 changed files with 6 additions and 4 deletions

View File

@ -150,8 +150,6 @@ public class UnloadingTest extends GCTestBase {
}
private static void checkGCCounters() {
// System.out.println("WhiteBox.getWhiteBox().g1GetTotalCollections() = \t" + WhiteBox.getWhiteBox().g1GetTotalCollections());
// System.out.println("WhiteBox.getWhiteBox().g1GetTotalFullCollections() = \t" + WhiteBox.getWhiteBox().g1GetTotalFullCollections());
GarbageCollectorMXBean oldGenBean = null;
for (GarbageCollectorMXBean bean : ManagementFactory.getGarbageCollectorMXBeans()) {
System.out.println("bean.getName() = \t\"" + bean.getName() + "\", bean.getCollectionCount() = \t" + bean.getCollectionCount());
@ -159,9 +157,9 @@ public class UnloadingTest extends GCTestBase {
oldGenBean = bean;
}
}
// if (WhiteBox.getWhiteBox().g1GetTotalFullCollections() != 0 || (oldGenBean != null && oldGenBean.getCollectionCount() != 0)) {
if (oldGenBean != null && oldGenBean.getCollectionCount() != 0) {
throw new RuntimeException("Full gc happened. Test was useless.");
throw new SkippedException("Full gc happened, skip the test.");
}
}

View File

@ -23,6 +23,8 @@
package nsk.share.test;
import jtreg.SkippedException;
import nsk.share.log.*;
import nsk.share.runner.*;
import nsk.share.TestFailure;
@ -82,6 +84,8 @@ public class Tests {
((Runnable) o).run();
if (o instanceof TestExitCode)
exitCode = ((TestExitCode) o).getExitCode();
} catch (SkippedException se) {
throw se;
} catch (RuntimeException t) {
getLog().error(t);
exitCode = 97;