Disable usage of system level jshell history in test/hotspot/jtreg/runtime/os/TestWXHealing.java

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Fixed
    • Priority: P4
    • 27
    • Affects Version/s: 27
    • Component/s: hotspot
    • b11

      The test test/hotspot/jtreg/runtime/os/TestWXHealing.java launches a java application which then launches jshell. That test was recently updated in JDK-8377425 and now has 2 "@test" definitions, which means that these two test definitions in TestWXHealing.java will concurrently launch jshell, one each in each test execution, on the same host.

      The internal implementation of jshell, when being launched, uses a persistent storage that loads jshell history using java.util.prefs.Preferences API. There's a bug in this part of the code in jshell (or in the Preferences API implementation), likely due to some race condition, which causes it to run into a NullPointerException:

      Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "text" is null
          at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.countTrailintBackslashes(ConsoleIOContext.java:310)
          at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.<init>(ConsoleIOContext.java:209)
          at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:1018)
          at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.start(JShellToolBuilder.java:273)
          at WXHealing.main(WXHealing.java:46)

      This causes intermittent failures in the test/hotspot/jtreg/runtime/os/TestWXHealing.java test. The bug itself is being tracked in JDK-8347418, but in the meantime, to reduce the noise in CI, this test can be updated to workaround this issue by not using the system level persistence storage of jshell.

      Given what the TestWXHealing.java test is for, the jshell history is unnecessary for this test and thus this workaround shouldn't affect the original intention of that test.

            Assignee:
            Jaikiran Pai
            Reporter:
            Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: