JShell AbstractStopExecutionTest does not stop reliably

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: 25
    • Component/s: tools
    • generic
    • generic

      The JShell regression test support class AbstractStopExecutionTest.java provides code that starts a JShell evaluation in one thread and then invokes JShell.stop() to interrupt that evaluation from another thread.

      This class uses a boolean field to synchronize the action between threads. However, this field is not marked volatile and so the communication is unreliable. As a result, in rare cases, the test can fail due to a timeout.

      The simple fix is to make the field volatile. This has been verified in testing.

            Assignee:
            Archie Cobbs
            Reporter:
            Archie Cobbs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: