Skip to content

Commit

Permalink
8308910: Allow executeAndLog to accept running process
Browse files Browse the repository at this point in the history
Backport-of: fc288568f2c589975463d30f8c6d0e2484f0bf14
  • Loading branch information
GoeLin committed Oct 30, 2023
1 parent 46ce8cb commit 910e2c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/lib/jdk/test/lib/cds/CDSTestUtils.java
Expand Up @@ -558,8 +558,12 @@ public static File getSourceFile(String name) {

// ============================= Logging
public static OutputAnalyzer executeAndLog(ProcessBuilder pb, String logName) throws Exception {
return executeAndLog(pb.start(), logName);
}

public static OutputAnalyzer executeAndLog(Process process, String logName) throws Exception {
long started = System.currentTimeMillis();
OutputAnalyzer output = new OutputAnalyzer(pb.start());
OutputAnalyzer output = new OutputAnalyzer(process);

writeFile(getOutputFile(logName + ".stdout"), output.getStdout());
writeFile(getOutputFile(logName + ".stderr"), output.getStderr());
Expand Down

1 comment on commit 910e2c4

@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.