On Tue, 9 Jun 2026 13:23:50 GMT, Dusan Balek <[email protected]> wrote:

>> test/langtools/tools/javac/SystemFilesClosed.java line 84:
>> 
>>> 82: 
>>> 83:         try (StandardJavaFileManager fileManager = 
>>> compiler.getStandardFileManager(null, null, null)) {
>>> 84:             compiler.getTask(null, fileManager, null, 
>>> List.of("--system", targetSystem), null, List.of(compilationUnit))
>> 
>> I'm puzzled by the need to fork lsof to look at the output of the current 
>> process. I'm wondering if the return from call should be checked so that the 
>> test fails if it returns false.
>
> This test does not care about compilation result (if the source compiles 
> without errors or not). It is intended to test whether compilation does not 
> leave any files opened after it finishes (so the lsof is used).

Okay but the concern with using lsof (or 
UnixOperatingSystemMXBean.getOpenFileDescriptorCount before/after) is that the 
file descriptor usage increase as a side effect of something else. I think it 
would require confident that it is stable in all the higher tiers, only because 
it's hard to get tests like this stable.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31417#discussion_r3381126468

Reply via email to