RFR 8205547 : FileChannel/CleanerTest.java fails due to expected FD count

Paul Sandoz paul.sandoz at oracle.com
Mon Jun 25 17:41:38 UTC 2018


Hi Roger,

Are you missing the throwing of an exception when the fdCount != fdCount0? (and relatedly i could not tell if the print statements were for temporary debugging and you intended to remove them)

Since you check before hand for support of UnixOperatingSystemMXBean there appears no need for the method getFdCount can you can reuse the local variable unixMxBean. (If the check fails it suggests the @requires is incorrect, implying the test should fail.)

Paul.


> On Jun 25, 2018, at 8:24 AM, Roger Riggs <Roger.Riggs at Oracle.com> wrote:
> 
> Please review a test improvement to avoid unexpected file opens/closes during the file channel CleanerTest.
> The test now follows the pattern of the other java/io/File*/UnreferencedXXXClosesFd tests by waiting
> for the cleaner and file descriptors to be reclaimed by GC.
> 
> Webrev:
>   http://cr.openjdk.java.net/~rriggs/webrev-fd-count-wrong-8205547/
> 
> Thanks, Roger
> 



More information about the core-libs-dev mailing list