On Thu, 25 Sep 2025 17:17:56 GMT, Alexey Ivanov <[email protected]> wrote:

>> test/jdk/java/awt/Mouse/EnterExitEvents/DragWindowTest.java line 83:
>> 
>>> 81:             SwingUtilities.invokeAndWait(() -> {
>>> 82:                 button.addMouseListener(new ButtonMouseListener());
>>> 83:                 pointToDrag = getCenterPoint(button);
>> 
>> Can we move this block to l72 right after we get pointToClick...since button 
>> is already initialised by now..
>> It might bring some instability while we are in the midst of drag to do this 
>> block and then probably we can remove this additional delay when we have 
>> autoDelay
>
> I'm in favour of adding listeners when UI is created unless the test logic 
> depends on adding the listener only later.

I have moved the listener addition to the createUI method and combined the 
`getCenterPoint` calls to one `invokeAndWait` block at the start. However, this 
did not alleviate the need for the additional delays. Removing the delays 
caused failures on linux and macos. However, when the delays are re-added, the 
test passes again on all OS's through 3 sets of 100 repeats.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27478#discussion_r2380039852

Reply via email to