On Wed, 2 Sep 2026 17:19:08 GMT, Andy Goryachev <[email protected]> wrote:
>> modules/javafx.graphics/src/test/java/test/javafx/scene/input/DataFormatTest.java
>> line 145:
>>
>>> 143: @Test
>>> 144: public void concurrencyWithSingleID() throws Exception {
>>> 145: long duration = 5_000;
>>
>> 5 seconds for a single test is probably too long. Running all the tests in
>> the controls module takes about 2 minutes. I tested with 0.5 seconds and
>> there's no issue.
>>
>> The way I do these race tests is with a `@RepeatedTest(M)` instead of the
>> sleep. Each tests runs N concurrent threads (N being "a lot") and the time
>> it takes them to finish is hardware-based, but running them M times
>> deterministically gives the non-flakiness guarantee. This way you don't need
>> to set a hardware-independent duration and the tests completes as fast as
>> possible. It's not like faster hardware requires more runs.
>
> switched to `@RepeatedTest and 100k iterations per test (~0.2 sec per test),
> total test is about 2.3 seconds on mac M1
The number of iterations is way more than is realistically needed for a test.
Takes 6 seconds for me with a `threadCount` of 49.
In any case, does the test fail for you without the added synchronization?
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2197#discussion_r3918432233