On Thu, 29 Jan 2026 14:30:18 GMT, Roger Riggs <[email protected]> wrote:
>> Hi all,
>>
>> Test java/lang/ProcessBuilder/PipelineLeaksFD.java intermittent timed out,
>> because `lsof` invoke huast lots of time when the tested machine has many
>> processes, and the processes open too many files.
>>
>> This PR add parameter -p pid to `lsof`, which will only generate output from
>> the wanted processes, rather than all the processes on the machine, this
>> will make `lsof` use less time to finish significantly. And this PR also use
>> `Process.waitFor(long timeout, TimeUnit unit)` instead of `waitFor()` which
>> will avoid waitFor invoke cause test timed out. Delete the history lsof
>> input and output files will make diagnosis more easy.
>>
>> Change has been verifed locally. The imtermittent timed out do not observed
>> anymore.
>
> test/jdk/java/lang/ProcessBuilder/PipelineLeaksFD.java line 246:
>
>> 244: pids.forEach(pid -> command.append(",").append(pid));
>> 245: System.out.println("Running lsof command: " + command);
>> 246: try (Process p = new ProcessBuilder(command.toString().split("
>> "))
>
> The purpose of NOT using -p was to be able to identify the other processes
> that may be linked by their file descriptors/handles if the case of a failure.
> Without a more complete list of file descriptors, the diagnostic information
> is not available to track down the other process.
> I'd prefer that the timeout be increased.
Having just updated this test, I would have been interested in fixing any
follow on problems myself.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29478#discussion_r2741961961