Duplicate :
|
|
Duplicate :
|
|
Relates :
|
|
Relates :
|
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.
|