提交 5289ecdd 编写于 作者: S smarks

7123972: test/java/lang/annotation/loaderLeak/Main.java fails intermittently

Reviewed-by: dholmes, smarks
Contributed-by: NEric Wang <yiming.wang@oracle.com>
上级 36739fa7
......@@ -122,9 +122,6 @@
# jdk_lang
# 7123972
java/lang/annotation/loaderLeak/Main.java generic-all
# 6944188
java/lang/management/ThreadMXBean/ThreadStateTest.java generic-all
......
......@@ -57,9 +57,17 @@ public class Main {
System.gc();
System.gc();
loader = null;
// 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();
System.gc();
if (c.get() != null) throw new AssertionError();
Thread.sleep(20);
if (c.get() == null) {
break;
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册