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

(thread) TEST_BUG java/lang/Thread/ThreadStateTest.java fails intermittently

XMLWordPrintable

    • b01
    • generic, arm
    • generic, linux, solaris
    • Verified

        java/lang/Thread/ThreadStateTest.java can fail with when checkThreadState finds an unexpected state.

        Exception in thread "main" java.lang.RuntimeException: MyThread expected to have TERMINATED but got RUNNABLE
        at ThreadStateTest.checkThreadState(ThreadStateTest.java:119)
        at ThreadStateTest.main(ThreadStateTest.java:96)

        There are races between the thread being put in a specific state and the thread testing for that state. The failure is not see that often, but is easily reproducible with -Xcomp, as this changes the timing of the execution of the test, see CR 6725455.

        The test should be updated in a similar fashion to java/lang/management/ThreadMXBean/ThreadStateTest.java, see CR 5080203. That is, retry the thread state check a number of times before failing.

              chegar Chris Hegarty
              chegar Chris Hegarty
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: