jpackage: fix Win8365790Test test

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 27
    • Affects Version/s: 26
    • Component/s: tools
    • master
    • generic
    • windows

      Even though the test passes, it throws an unexpected exception:

      Exception in thread "" java.lang.NullPointerException: Cannot invoke "jdk.jpackage.test.TestInstance.notifyAssert()" because the return value of "jdk.jpackage.test.TKit.currentTest()" is null
              at jdk.jpackage.test.TKit.assertEquals(TKit.java:679)
              at jdk.jpackage.test.Executor$Result.assertExitCodeIs(Executor.java:284)
              at jdk.jpackage.test.Executor$Result.assertExitCodeIs(Executor.java:273)
              at jdk.jpackage.test.Executor.execute(Executor.java:329)
              at jdk.jpackage.test.HelloApp.execute(HelloApp.java:520)
              at jdk.jpackage.test.HelloApp.configureAndExecute(HelloApp.java:510)
              at Win8365790Test.lambda$runLauncher$0(Win8365790Test.java:105)
              at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)

      This is a regression from JDK-8370136 patch.

      The issue remained unnoticed as it didn't fail the test. It occurs in the auxiliary thread after it successfully executes the workload, and there is no exception check in the main thread.

      Rework the test to prevent the exception from being thrown, and such that if any exception occurs in the auxiliary thread, it would fail the test.

            Assignee:
            Alexey Semenyuk
            Reporter:
            Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: