Mercurial > hg > openjdk > jdk8u > jdk
changeset 11446:041d28c98c29
8150533: Test java/util/logging/LogManagerAppContextDeadlock.java times out intermittently.
Summary: This is a test bug caused by a Logger being garbage collected too early.
Reviewed-by: darcy
author | dfuchs |
---|---|
date | Fri, 26 Feb 2016 12:11:28 +0100 |
parents | 5972ad24ef27 |
children | 1bac251d8776 |
files | test/java/util/logging/LogManagerAppContextDeadlock.java |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/test/java/util/logging/LogManagerAppContextDeadlock.java Wed Nov 19 17:51:06 2014 +0300 +++ b/test/java/util/logging/LogManagerAppContextDeadlock.java Fri Feb 26 12:11:28 2016 +0100 @@ -136,6 +136,7 @@ t1.setDaemon(true); t1.start(); Thread t2 = new Thread() { + public Object logger; public void run() { sem3.release(); try { @@ -146,7 +147,10 @@ Thread.interrupted(); } System.out.println("Logger.getLogger(name).info(name)"); - Logger.getLogger(test.name());//.info(name); + // stick the logger in an instance variable to prevent it + // from being garbage collected before the main thread + // calls LogManager.getLogger() below. + logger = Logger.getLogger(test.name());//.info(name); System.out.println("Done: Logger.getLogger(name).info(name)"); } };