RFR: 8247494: Test failure in ImageRaceTest on some systems
Kevin Rushforth
kcr at openjdk.java.net
Thu Oct 22 14:57:09 UTC 2020
On Thu, 22 Oct 2020 12:29:51 GMT, Pankaj Bansal <pbansal at openjdk.org> wrote:
> The test test.com.sun.javafx.image.impl.ImageRaceTest is fails intermittently in linux
>
> This is caused by use of Thread.yield. Thread.yield is used to pause the current thread for some time. It gives a hint to thread scheduler that the current thread should pause and other threads with same or higher priority should execute. But it is a hint only and can be ignored. so the current thread may very well continue to operate. This causes the test to fail on some slow machines.
>
> Better approach in this scenario would be to use Thread.sleep to make the thread wait for some time for some event.
On my Oracle Linux 7.7 VM, the current test fails always. With your fix I ran 100 iterations of the test with 0 failures.
+1
-------------
Marked as reviewed by kcr (Lead).
PR: https://git.openjdk.java.net/jfx/pull/332
More information about the openjfx-dev
mailing list