diff --git a/test/ProblemList.txt b/test/ProblemList.txt index 7229491100009f8c455ea63d6b346b1267dd6a83..af875d9fb8b39801d39f3cdc1b1721bf7f0008d4 100644 --- a/test/ProblemList.txt +++ b/test/ProblemList.txt @@ -122,9 +122,6 @@ # jdk_lang -# 7123972 -java/lang/annotation/loaderLeak/Main.java generic-all - # 6944188 java/lang/management/ThreadMXBean/ThreadStateTest.java generic-all diff --git a/test/java/lang/annotation/loaderLeak/Main.java b/test/java/lang/annotation/loaderLeak/Main.java index dc835a9dcd0dd3fb483be2eb72df5e7624ccab60..fceda8195ff475f24b9278f3d412d377bd1ccb4e 100644 --- a/test/java/lang/annotation/loaderLeak/Main.java +++ b/test/java/lang/annotation/loaderLeak/Main.java @@ -57,9 +57,17 @@ public class Main { System.gc(); System.gc(); loader = null; - System.gc(); - System.gc(); - if (c.get() != null) throw new AssertionError(); + + // Might require multiple calls to System.gc() for weak-references + // processing to be complete. If the weak-reference is not cleared as + // expected we will hang here until timed out by the test harness. + while (true) { + System.gc(); + Thread.sleep(20); + if (c.get() == null) { + break; + } + } } }