[jdk21u-dev] RFR: 8352419: Test tools/jpackage/share/ErrorTest.java#id0 and #id1 fail
Paul Hohensee
phh at openjdk.org
Tue Feb 24 17:32:52 UTC 2026
On Mon, 23 Feb 2026 19:09:26 GMT, Min Choi <duke at openjdk.org> wrote:
> In order to fix https://github.com/openjdk/jdk21u-dev/pull/2606, consensus was reached to pull the SkippedException hardcode change from tip to fix.
>
> The other parts of the backport require additional backports that are not trivial.
>
> The upstream commit [JDK-8352419](https://bugs.openjdk.org/browse/JDK-8352419) https://github.com/openjdk/jdk/commit/70e325004536eb9b79f4943f27eed4ac6cec8bd5 contains changes to 4 files:
> - `TKit.java` - Embeds `jtreg.SkippedException` bytecode (**included in this backport**)
> - `PackageType.java` - Adds new methods used by refactored ErrorTest
> - `PackageTest.java` - Adds filtering logic for new ErrorTest infrastructure
> - `ErrorTest.java` - Uses new `PackageTypeSpec` record and test infrastructure
>
> Only the `TKit.java` change is self-contained. The other changes depend on [JDK-8351372](https://bugs.openjdk.org/browse/JDK-8351372) https://github.com/openjdk/jdk/commit/3aa6d62afecbea5684618bc82425e59404233be5 ("Improve negative tests coverage of jpackage"), which is a big refactoring that completely rewrote `ErrorTest.java` (~700 lines changed).
>
> #### Required Prerequisites for Full Backport
>
> | JBS ID | Description | Impact |
> |--------|-------------|--------|
> | [JDK-8351372](https://bugs.openjdk.org/browse/JDK-8351372) | Improve negative tests coverage of jpackage | Complete `ErrorTest.java` rewrite (581 insertions, 78 deletions) |
> | [JDK-8352293](https://bugs.openjdk.org/browse/JDK-8352293) | Fix rpm packages on Ubuntu after 8351372 | Follow-up fix (1 line in `PackageType.java`) |
>
> These backports are unnecessary for JDK 21 - they are test infrastructure improvements for jdk-tip that don't exist in 21.
>
> This PR backports only the `JtregSkippedExceptionClass` inner class from `TKit.java`, which embeds the `jtreg.SkippedException` bytecode via Base64 and dynamically defines the class at runtime. This eliminates the need for `@library /test/lib` and `@build jtreg.SkippedException` in jpackage tests and fixes all jpackage tests that call SkippedException through reflection.
>
> Tested all tools/jpackage tests and also ran a simple test and it skips correctly now.
>
> import jdk.jpackage.test.Annotations.Test;
> import jdk.jpackage.test.TKit;
>
> /*
> * @test
> * @summary Test TKit.throwSkippedException() without @library /test/lib
> * @library /test/jdk/tools/jpackage/helpers
> * @build jdk.jpackage.test.*
> * @build TKitSkipTest
> * @run main/othervm -Xmx512m jdk.jpackage.test.Main
> * --jpt-run=TKitSkipTest
> */
> public class TKitSkipTest {
>
> @...
Marked as reviewed by phh (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk21u-dev/pull/2633#pullrequestreview-3849469739
More information about the jdk-updates-dev
mailing list