RFR: 8023263: [TESTBUG] Test closed/java/awt/Focus/InactiveWindowTest/InactiveFocusRace fails due to not enough time to initialize graphic components

Sergey Bylokhov serb at openjdk.org
Tue Sep 9 17:48:12 UTC 2025


On Tue, 9 Sep 2025 04:34:13 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> Test was failing due to lack of time between initializing graphics components and test start.
> Added robot delay and execution under EDT.
> 
> Several iterations of test is passing so deproblemlisting, CI job link in JBS

test/jdk/java/awt/Focus/InactiveFocusRace.java line 109:

> 107:             }
> 108:         });
> 109:         inactiveFrame.setVisible(true);

The previous version used a Semaphore to wait until the frame became active or the button received focus, but it didn’t check the second inactive frame.
I think what we should do is first show the "inactive" frame using the same Semaphore. Then, once it becomes visible, we should show another "active" frame.
This will ensure that the frame we intend to click below remains inactive/unfocused.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27156#discussion_r2334342651


More information about the client-libs-dev mailing list