8375080: The tools/jpackage/windows/Win8365790Test.java may fail with ClassNotFoundException: jtreg.SkippedException#2606
Conversation
…ssNotFoundException: jtreg.SkippedException
|
👋 Welcome back mmm-choi! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This seems to have been discussed in https://bugs.openjdk.org/browse/JDK-8376188 as well. cc @adamfarley |
|
Isn't it the same issue as the one discussed in openjdk/jdk#29416? The better fix would be to backport the part of the JDK-8352419 fix which hardcodes SkippedExeption class into test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java. This way, it will be consistent across all releases, and other jpackage tests will benefit from the properly working "skip the test" mechanism. |
|
This issue should be fixed when #2605 gets merged. It increases the minimum version of jtreg to 7.5.1+1, which doesn't have this issue. |
|
Just checked whether jtreg 7.5.1+1 fixes the issue and the test still fails with ClassNotFoundException for me. I also ran a very simple test against 7.5.1 and it fails. I verified that this simple test skips correctly in 25. Please let me know how I can make this test pass with bumping Jtreg to 7.5.1+1. |
|
Looking into this. |
I don't see how it will work unless Jtreg to 7.5.1+1 provides a copy of the @sormuras can you comment on the matter? |
|
I agree, Alexey. I believe you added a copy of the class to TKit.java in jdk25 here, to remove the dependency on SkippedException: |
|
|
|
As @sormuras confirmed, jtreg doesn't provide a copy of This means, bumping Jtreg to 7.5.1+1 in JDK21 will not automatically fix the bug with the missing |
Any chance the tests were executed in a slightly different environment that looked good enough for Win8365790Test, that it didn't attempt to throw |
It's possible, yes. I thought upgrading to 7.5.1 would solve this issue, and it doesn't. Thank you for clarifying. |
|
Thank you everyone for reviewing! I believe @alexeysemenyukoracle's solution is the correct approach. We should backport the relevant parts of openjdk/jdk#24294 that hardcode SkippedException, which will benefit other tests in JDK 21 and 17 that rely on this. We have two options:
I'd appreciate input on which approach to prefer. Both paths will achieve the same end result, so I'm happy to go with whatever makes most sense. |
I support this variant. I don't see much point in an ad hoc fix for a specific test. We know the issue is not specific to Win8365790Test test; almost any jpackage test may fail when executed in an environment where it should be skipped. It just happens that the issue manifests in the Win8365790Test test. So let's proceed directly to a solution that fixes the problem in a generic way. |
|
|
Win8365790TestcallsTKit.throwSkippedException()when the test environment doesn't support Ctrl+C signal delivery.In JDK 17/21,
TKit.throwSkippedException()uses reflection (Class.forName("jtreg.SkippedException")) to load the exception class, which requiresjtreg.SkippedExceptionto be on the classpath.The test was missing the jtreg directives to build this class:
This pattern is already used by other jpackage tests that call
throwSkippedException()(e.g.,SigningAppImageTest.java).Note: JDK 25+ has this fixed differently via JDK-8352419 which hardcodes
SkippedExceptiondirectly inTKit.java.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/2606/head:pull/2606$ git checkout pull/2606Update a local copy of the PR:
$ git checkout pull/2606$ git pull https://git.openjdk.org/jdk21u-dev.git pull/2606/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2606View PR using the GUI difftool:
$ git pr show -t 2606Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/2606.diff
Using Webrev
Link to Webrev Comment