RFR: 8352419: Test tools/jpackage/share/ErrorTest.java#id0 and #id1 fail
Arno Zeller
azeller at openjdk.org
Tue Apr 1 05:13:17 UTC 2025
On Fri, 28 Mar 2025 15:02:05 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:
> Make tools/jpackage/share/ErrorTest.java test safely handle the case when native bundling is unavailable on the test host.
>
> Additionally:
> - If native bundling is unavailable on the test host, PackageTest will throw `jtreg.SkippedException` and mark the test as skipped instead of silently doing nothing. This should mark a few jpackage tests "skipped" in tests runs on Alpine Linux that doesn't support either .deb or .rpm packaging.
> - Get rid of the dependency on `jtreg.SkippedException` from `/jdk/test` lib as this exception can be thrown from almost every jpackage test because of the changes in PackageTest. Instead embed `jtreg.SkippedException` classfile in TKit.java source and load it from there. This is a less intrusive alternative to adding
>
> * @library /test/lib
> * @build jtreg.SkippedException
>
> in every jtreg test declaration
I see a test failure in tools/jpackage/helpers-test/jdk/jpackage/test/PackageTestTest.java with this PR when I run the test on Alpine without rpm or dpkg installed.
The output contains a 82 SSkipped Exceptions like :
jtreg.SkippedException: None of the native packagers supported in this environment
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
...
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
And in the end...
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
FAILED jdk.jpackage.test.PackageTestTest::runJPackageTests 'runJPackageTests(Path)' [1593ms]
JavaTest Message: JUnit Platform Failure(s): 1
[ JUnit Containers: found 4, started 4, succeeded 4, failed 0, aborted 0, skipped 0]
[ JUnit Tests: found 1, started 1, succeeded 0, failed 1, aborted 0, skipped 0]
java.lang.Exception: JUnit test failure
at com.sun.javatest.regtest.agent.JUnitRunner.runWithJUnitPlatform(JUnitRunner.java:169)
at com.sun.javatest.regtest.agent.JUnitRunner.main(JUnitRunner.java:102)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:335)
at java.base/java.lang.Thread.run(Thread.java:1447)
JavaTest Message: Test threw exception: java.lang.Exception
JavaTest Message: shutting down test
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24294#issuecomment-2768113832
More information about the core-libs-dev
mailing list