From 09522db5aa9503131381bbb4fe3f2eae829645ce Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Thu, 2 Dec 2021 01:29:52 +0000 Subject: [PATCH] 8277647: [REDO] JDK-8277507 Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures Reviewed-by: sundar --- .../jpackage/helpers/jdk/jpackage/test/JPackageCommand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java index 3315de374c3..b68fe08bd1e 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java @@ -768,6 +768,11 @@ public final class JPackageCommand extends CommandArguments { } private JPackageCommand adjustArgumentsBeforeExecution() { + if (!isWithToolProvider()) { + // if jpackage is launched as a process then set the jlink.debug system property + // to allow the jlink process to print exception stacktraces on any failure + addArgument("-J-Djlink.debug=true"); + } if (!hasArgument("--runtime-image") && !hasArgument("--app-image") && DEFAULT_RUNTIME_IMAGE != null && !ignoreDefaultRuntime) { addArguments("--runtime-image", DEFAULT_RUNTIME_IMAGE); }