Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8359131

JShell AbstractStopExecutionTest does not stop reliably

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 25
    • 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.

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

              Created:
              Updated:
              Resolved: