JDK-8029595 : Avoid cases of Logger being GC'ed in tests
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.logging
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-12-05
  • Updated: 2014-12-03
  • Resolved: 2014-09-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
I scanned testcases for patterns where Loggers could potentially be collected by GC and cause a test failure. See Logger.getLogger API : 
http://docs.oracle.com/javase/7/docs/api/java/util/logging/Logger.html#getLogger(java.lang.String)

These tests probably deserve some attention : 

test/tools/jar/UpdateManifest.java :
    -  Logger.getLogger("java.util.jar").setLevel(Level.OFF);
    
test/java/util/logging/Logger/getGlobal/TestGetGlobalConcurrent.java
    - Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info(messages[i]);
    
test/java/util/logging/ParentLoggersTest.java
    - Logger.getLogger(LOGGER_NAME_1);
    - Logger.getLogger(LOGGER_NAME_2);
    
test/java/util/logging/LogManager/RootLogger/setLevel/TestRootLoggerLevel.java
    - 5-6 cases that need checking ?
    
test/java/util/logging/CustomLogManagerTest.java
    - line 46 - 48
    
test/closed/sun/security/ssl/sanity/compatibility/manual/Https.java
     - closed testcase. may be suspect.
Comments
Closing this: the tests that needed fixing have been fixed (see linked issues).
11-09-2014

The case of ParentLoggersTest is now tracked (and fixed) by JDK-8031068. The case of UpdateManifest.java is now tracked (and fixed) by JDK-8031525.
10-01-2014

Summary of my investigations: - Two of the tests above need to be fixed - these are: test/tools/jar/UpdateManifest.java test/java/util/logging/ParentLoggersTest.java - The manual tests should probably be fixed too - although not fixing probably won't make it fail. test/closed/sun/security/ssl/sanity/compatibility/manual/Https.java The others tests listed should be safe from arbitrary GC of no longer referenced loggers.
10-12-2013