RFR: 8301247: JPackage app-image exe launches multiple exe's in JDK 17+ [v2]
Alexey Semenyuk
asemenyuk at openjdk.org
Mon Sep 18 20:21:52 UTC 2023
On Fri, 15 Sep 2023 13:32:39 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:
>> On Windows, restart app launcher in a way that when the parent app launcher process terminates, the child app launcher process is automatically terminated.
>
> Alexey Semenyuk has updated the pull request incrementally with two additional commits since the last revision:
>
> - Misplaced canRunLauncher() check.
> - Added a test to cover the test case
Test output:
[23:18:54.466] Parsing [--jpt-run=Win8301247Test]...
[23:18:54.502] Win8301247Test.test -> [public void Win8301247Test.test() throws java.io.IOException,java.lang.InterruptedException]
[23:18:54.524] Create: Win8301247Test.test
[23:18:54.527] [ RUN ] Win8301247Test.test
[23:18:54.804] TRACE: Bundler msi supported
[23:18:54.976] TRACE: Bundler exe supported
[23:18:55.007] TRACE: exec: Execute tool provider [javac -d .\test\jar-workdir C:\ade\mesos\work_dir\jib-master\install\2023-09-14-2207021.alexey.semenyuk.jdk10\src.full\open\test\jdk\tools\jpackage\apps\Hello.java](4)...
[23:18:56.167] TRACE: exec: Done. Exit code: 0
[23:18:56.168] TRACE: assertEquals(0): Check command tool provider [javac -d .\test\jar-workdir C:\ade\mesos\work_dir\jib-master\install\2023-09-14-2207021.alexey.semenyuk.jdk10\src.full\open\test\jdk\tools\jpackage\apps\Hello.java](4) exited with 0 code
[23:18:56.171] TRACE: exec: Execute tool provider [jar -c -f .\test\input\hello.jar -C .\test\jar-workdir .](7)...
[23:18:56.256] TRACE: exec: Done. Exit code: 0
[23:18:56.256] TRACE: assertEquals(0): Check command tool provider [jar -c -f .\test\input\hello.jar -C .\test\jar-workdir .](7) exited with 0 code
[23:18:56.264] TRACE: exec: Execute [windows-x64.jdk\jdk-22\bin\jpackage.exe --input .\test\input --dest .\test\output --name Win8301247Test --type app-image --main-jar hello.jar --main-class Hello --win-console --java-options -Djpackage.test.noexit=true -J-Djlink.debug=true --verbose](18); inherit I/O...
[23:18:56.647] Creating app package: Win8301247Test in C:\sb\prod\1694731099\testoutput\test-support\jtreg_open_test_jdk_tools_jpackage\scratch\1.\test\output
[23:19:03.132] Command [PID: -1]:
jlink --output .\test\output\Win8301247Test\runtime --module-path windows-x64.jdk\\jdk-22\\jmods --add-modules jdk.management.jfr,java.rmi,jdk.jdi,jdk.charsets,java.xml,jdk.xml.dom,java.datatransfer,jdk.jstatd,jdk.httpserver,java.desktop,java.security.sasl,jdk.zipfs,java.base,jdk.javadoc,jdk.management.agent,jdk.jshell,jdk.editpad,jdk.sctp,jdk.jsobject,java.sql.rowset,jdk.unsupported,jdk.jlink,java.smartcardio,java.security.jgss,java.compiler,jdk.nio.mapmode,jdk.dynalink,jdk.unsupported.desktop,jdk.accessibility,jdk.security.jgss,jdk.incubator.vector,java.sql,java.transaction.xa,java.xml.crypto,java.logging,jdk.jfr,jdk.crypto.cryptoki,jdk.random,jdk.net,java.naming,jdk.internal.ed,java.prefs,java.net.http,jdk.compiler,jdk.naming.rmi,jdk.internal.opt,jdk.jconsole,jdk.attach,jdk.crypto.mscapi,jdk.internal.le,java.management,jdk.jdwp.agent,jdk.internal.jvmstat,java.instrument,jdk.management,jdk.security.auth,java.scripting,jdk.jdeps,jdk.jartool,java.management.rmi,jdk.jpackage,jdk.n
aming.dns,jdk.localedata --strip-native-commands --strip-debug --no-man-pages --no-header-files
[23:19:03.132] Output:
WARNING: Using incubator modules: jdk.incubator.vector
[23:19:03.132] Returned: 0
[23:19:03.137] Using default package resource JavaApp.ico [icon] (add Win8301247Test.ico to the resource-dir to customize).
[23:19:03.169] Warning: Windows Defender may prevent jpackage from functioning. If there is an issue, it can be addressed by either disabling realtime monitoring, or adding an exclusion for the directory "c:\sb\prod\1694731099\testoutput\test-support\jtreg_open_test_jdk_tools_jpackage\tmp\jdk.jpackage11407434922052477626".
[23:19:03.172] Using default package resource WinLauncher.template [Template for creating executable properties file] (add Win8301247Test.properties to the resource-dir to customize).
[23:19:03.208] Succeeded in building Windows Application Image package
[23:19:03.319] TRACE: exec: Done. Exit code: 0
[23:19:03.320] TRACE: assertEquals(0): Check command [windows-x64.jdk\jdk-22\bin\jpackage.exe --input .\test\input --dest .\test\output --name Win8301247Test --type app-image --main-jar hello.jar --main-class Hello --win-console --java-options -Djpackage.test.noexit=true -J-Djlink.debug=true --verbose](18) exited with 0 code
[23:19:03.341] TRACE: assertStringListEquals(): Check there is only one file with [.jpackage.xml] name in the package
[23:19:03.344] TRACE: assertStringListEquals(1, .\test\output\Win8301247Test\app.jpackage.xml)
[23:19:03.352] TRACE: assertStringListEquals(): Check there are no files with [.package] name in the package
[23:19:03.353] TRACE: assertTrue(): Check [.\test\output\Win8301247Test\runtime] path exists
[23:19:03.353] TRACE: assertTrue(): Check [.\test\output\Win8301247Test\runtime] is a directory
[23:19:03.354] TRACE: assertTrue(): Check [.\test\output\Win8301247Test\Win8301247Test.exe] path exists
[23:19:03.354] TRACE: assertTrue(): Check [.\test\output\Win8301247Test\Win8301247Test.exe] is a file
[23:19:03.354] TRACE: assertTrue(): Check [.\test\output\Win8301247Test\Win8301247Test.exe] file is executable
[23:19:03.354] TRACE: assertTrue(): Check [.\test\output\Win8301247Test\app\Win8301247Test.cfg] path exists
[23:19:03.355] TRACE: assertTrue(): Check [.\test\output\Win8301247Test\app\Win8301247Test.cfg] is a file
[23:19:03.362] TRACE: Clearing PATH in environment
[23:19:03.363] TRACE: exec: Execute [C:\sb\prod\1694731099\testoutput\test-support\jtreg_open_test_jdk_tools_jpackage\scratch\1.\test\output\Win8301247Test\Win8301247Test.exe](1); save output; in directory [.\test]...
[23:19:13.361] TRACE: exec: Execute [wmic process where (name = "Win8301247Test.exe" ) get ProcessID,ParentProcessID](9); save output...
ParentProcessId ProcessId
41052 31224
31224 11344
[23:19:13.553] TRACE: exec: Done. Exit code: 0
[23:19:13.553] TRACE: assertEquals(0): Check command [wmic process where (name = "Win8301247Test.exe" ) get ProcessID,ParentProcessID](9) exited with 0 code
[23:19:13.557] TRACE: assertEquals(2): Check [2] app launcher processes found running
[23:19:13.557] TRACE: exec: Execute [taskkill /F /PID 31224](4); inherit I/O...
SUCCESS: The process with PID 31224 has been terminated.
[23:19:13.639] TRACE: exec: Done. Exit code: 1
[23:19:13.640] TRACE: exec: Done. Exit code: 0
[23:19:13.640] TRACE: assertEquals(0): Check command [taskkill /F /PID 31224](4) exited with 0 code
[23:19:18.649] TRACE: exec: Execute [wmic process where (name = "Win8301247Test.exe" ) get ProcessID,ParentProcessID](9); save output...
No Instance(s) Available.
[23:19:18.749] TRACE: exec: Done. Exit code: 0
[23:19:18.750] TRACE: assertEquals(0): Check command [wmic process where (name = "Win8301247Test.exe" ) get ProcessID,ParentProcessID](9) exited with 0 code
[23:19:18.750] TRACE: assertEquals(No Instance(s) Available.): Check no app launcher processes found running
[23:19:18.751] TRACE: Deleting [.\test] directory recursively
[23:19:18.862] [ OK ] Win8301247Test.test; checks=17
[23:19:18.863] [==========] 1 tests ran
[23:19:18.863] [ PASSED ] 1 test
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15690#issuecomment-1724307706
More information about the core-libs-dev
mailing list