From 024d9b131d6c2d5ee6c8cafdb05b9e9e299d588e Mon Sep 17 00:00:00 2001 From: Matias Saavedra Silva Date: Wed, 31 May 2023 13:50:04 +0000 Subject: [PATCH] 8308910: Allow executeAndLog to accept running process Reviewed-by: ccheung, iklam --- test/lib/jdk/test/lib/cds/CDSTestUtils.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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;