Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8214733: runtime/8176717/TestInheritFD.java timed out #255

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions test/hotspot/jtreg/runtime/8176717/TestInheritFD.java
Original file line number Diff line number Diff line change
@@ -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