Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8214733: runtime/8176717/TestInheritFD.java timed out
Backport-of: 4501ddda7f8e0eb9352a937030a62902bfaac647
  • Loading branch information
GoeLin committed Mar 17, 2022
1 parent 00f201d commit 90126f8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/hotspot/jtreg/runtime/8176717/TestInheritFD.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -79,6 +79,7 @@ public class TestInheritFD {
public static final String RETAINS_FD = "VM RESULT => RETAINS FD";
public static final String EXIT = "VM RESULT => VM EXIT";
public static final String LOG_SUFFIX = ".strangelogsuffixthatcanbecheckedfor";
public static final String USER_DIR = System.getProperty("user.dir");

// first VM
public static void main(String[] args) throws Exception {
Expand Down Expand Up @@ -187,10 +188,10 @@ static Optional<String[]> lsofCommand() {

static Collection<String> outputContainingFilenames() {
long pid = ProcessHandle.current().pid();

String[] command = lsofCommand().orElseThrow(() -> new RuntimeException("lsof like command not found"));
System.out.println("using command: " + command[0] + " " + command[1]);
return run(command[0], command[1], "" + pid).collect(toList());
// Only search the directory in which the VM is running (user.dir property).
System.out.println("using command: " + command[0] + " -a +d " + USER_DIR + " " + command[1] + " " + pid);
return run(command[0], "-a", "+d", USER_DIR, command[1], "" + pid).collect(toList());
}

static boolean findOpenLogFile(Collection<String> fileNames) {
Expand Down

1 comment on commit 90126f8

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.