RFR: 8271205: [windows] Intermittent test failure in test.javafx.scene.web.MiscellaneousTest::testDOMTimer
Jay Bhaskar
jbhaskar at openjdk.org
Tue Apr 25 12:31:14 UTC 2023
On Tue, 25 Apr 2023 12:18:17 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> Issue: [windows] Intermittent test failure in test.javafx.scene.web.MiscellaneousTest::testDOMTimer
>> Analysis:
>> setTimeout call is not a real-time function. it is considered just a minimum delay before the callback is executed. The actual time taken depends
>> 1. How long it takes to process any messages ahead of the already task in the queue?
>> 2. Current load on the CPU.
>> 3. The number of tasks being executed by the JS engine.
>> 4. current state of OS/Browser.
>>
>> However, we have to set a minimum timeout value of at least 10 ms, as recommended by Webkit/w3c. Setting value of 1o ms might prevent some un-defined behavior.
>
> modules/javafx.web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java line 187:
>
>> 185: int timeout = i * (1000 / timer.INTERVAL_COUNT);
>> 186: // Webkit recomends minimum timeout value should be 10
>> 187: if(timeout == 0) timeout = 10;
>
> Are you sure that the intermittent failures happen when the timeout value is 0? Based on the assertion message in the bug report, I didn't think this was the case, but I might be misinterpreting it.
Actually, I have tested many times without the above fix, the issue does not occur. it would be safe not to set the timeout value 0. In the Webkit Gtk port, whenever the timeout value is set to 0, it converts 0 to the minimum timeout value of 10 ms.
When we set the value to 0, it becomes an async callback, and a value greater than 0 becomes synced. So it is better to set the minimum timeout to 10 ms.
possibly this will reduce the failures, But it depends upon OS/browser status. We can't ascertain timeout to be real-time.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1113#discussion_r1176442281
More information about the openjfx-dev
mailing list