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

Test failure in ImageRaceTest on some systems

XMLWordPrintable

      On my Oracle Linux 7.7 VM I consistently get the following test failure:

      $ gradle --continue --info -PFULL_TEST=true cleanTest :systemTests:test --tests test.com.sun.javafx.image.impl.ImageRaceTest

      test.com.sun.javafx.image.impl.ImageRaceTest > testImageInitializationRaceCondition FAILED
          java.lang.RuntimeException: Initializer Thread[ByteGrayAlpha.ToByteGrayAlphaPre Initializer,5,main] never started
              at test.com.sun.javafx.image.impl.ImageRaceTest.forkAndJoinInitializers(ImageRaceTest.java:82)
              at test.com.sun.javafx.image.impl.ImageRaceTest.testImageInitializationRaceCondition(ImageRaceTest.java:240)

      This is due to the following fragile code in the test:

          while (!ready) { yield(); }

      Thread.yield is documented to be a hint and should not be used in this manner. The fix is to change Thread.yield to Thread.sleep(1) in the two places in the test it occurs.

            pbansal Pankaj Bansal (Inactive)
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: