RFR: 8214733: runtime/8176717/TestInheritFD.java timed out

Daniel D.Daugherty dcubed at openjdk.java.net
Fri Jan 21 20:02:10 UTC 2022


On Fri, 21 Jan 2022 15:23:54 GMT, Harold Seigel <hseigel at openjdk.org> wrote:

> Please review this small change to fix TestInheritFD.java.  The logs in the JBS bug indicate that the test probably timed out waiting for the lsof command to finish.  This fix adds the -a and +d <dir> options to the lsof command to limit its scope.  The +d option tells lsof to only look in the specified directory for open files.  The -a option combines the -p <pid> and the +d option.  (An alternative fix would be to use the -b option.)
> 
> The fix was tested by running the test 1000 times on Linux x64 and Mac OS aarch64.  The fix was also sanity tested on Linux aarch64, Mac OS x64, and windows.
> 
> Thanks, Harold

Thumbs up. Minor request for a comment.

test/hotspot/jtreg/runtime/8176717/TestInheritFD.java line 193:

> 191:         String[] command = lsofCommand().orElseThrow(() -> new RuntimeException("lsof like command not found"));
> 192:         System.out.println("using command: " + command[0] + " -a +d " + USER_DIR + " " + command[1] + " " + pid);
> 193:         return run(command[0], "-a", "+d", USER_DIR, command[1], "" + pid).collect(toList());

You might want to add a comment above L192:
// Only search the directory in which the VM is running (user.dir property):

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

Marked as reviewed by dcubed (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7179


More information about the hotspot-runtime-dev mailing list