Skip to content

Commit 024d9b1

Browse files
author
Matias Saavedra Silva
committed
8308910: Allow executeAndLog to accept running process
Reviewed-by: ccheung, iklam
1 parent 25b9803 commit 024d9b1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/lib/jdk/test/lib/cds/CDSTestUtils.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,11 +671,14 @@ public static void handleCDSRuntimeOptions(ProcessBuilder pb) {
671671

672672
// ============================= Logging
673673
public static OutputAnalyzer executeAndLog(ProcessBuilder pb, String logName) throws Exception {
674-
long started = System.currentTimeMillis();
675-
676674
handleCDSRuntimeOptions(pb);
675+
return executeAndLog(pb.start(), logName);
676+
}
677+
678+
public static OutputAnalyzer executeAndLog(Process process, String logName) throws Exception {
679+
long started = System.currentTimeMillis();
677680

678-
OutputAnalyzer output = new OutputAnalyzer(pb.start());
681+
OutputAnalyzer output = new OutputAnalyzer(process);
679682
String logFileNameStem =
680683
String.format("%04d", getNextLogCounter()) + "-" + logName;
681684

0 commit comments

Comments
 (0)