diff --git a/test/lib/jdk/test/lib/cds/CDSTestUtils.java b/test/lib/jdk/test/lib/cds/CDSTestUtils.java index 2d12a821731..629cf682384 100644 --- a/test/lib/jdk/test/lib/cds/CDSTestUtils.java +++ b/test/lib/jdk/test/lib/cds/CDSTestUtils.java @@ -671,11 +671,14 @@ public class CDSTestUtils { // ============================= Logging public static OutputAnalyzer executeAndLog(ProcessBuilder pb, String logName) throws Exception { + handleCDSRuntimeOptions(pb); + return executeAndLog(pb.start(), logName); + } + + public static OutputAnalyzer executeAndLog(Process process, String logName) throws Exception { long started = System.currentTimeMillis(); - handleCDSRuntimeOptions(pb); - - OutputAnalyzer output = new OutputAnalyzer(pb.start()); + OutputAnalyzer output = new OutputAnalyzer(process); String logFileNameStem = String.format("%04d", getNextLogCounter()) + "-" + logName;