8151797: java/lang/management/ThreadMXBean/ThreadLists.java : inconsistent results
Summary: Create ThreadMXBean at the beginning of test so that call-site cleaner thread will be started
Reviewed-by: sla
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java Mon Mar 21 20:39:54 2016 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java Tue Mar 22 01:13:06 2016 -0700
@@ -35,6 +35,11 @@
public class ThreadLists {
public static void main(String args[]) {
+ // Bug id : JDK-8151797
+ // Use a lambda expression so that call-site cleaner thread is started
+ Runnable printLambda = () -> {System.out.println("Starting Test");};
+ printLambda.run();
+
// get top-level thread group
ThreadGroup top = Thread.currentThread().getThreadGroup();
ThreadGroup parent;