RFR: 8346581: JRadioButton/ButtonGroupFocusTest.java fails in CI on Linux [v2]

Alexey Ivanov aivanov at openjdk.org
Thu Jan 9 19:53:41 UTC 2025


On Thu, 9 Jan 2025 00:00:48 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

>> Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Replace AWTEventListener and PropertyChangeListener with lambdas
>
> test/jdk/javax/swing/JRadioButton/ButtonGroupFocus/ButtonGroupFocusTest.java line 70:
> 
>> 68:     private static final CountDownLatch button4FocusLatch = new CountDownLatch(1);
>> 69: 
>> 70:     private static final CountDownLatch button2FocusLatch2 = new CountDownLatch(2);
> 
> Minor: Should the no. of  button2FocusLatch2 latches be 1? since we already have another button2FocusLatch 
> 
> Suggestion:
> 
>     private static final CountDownLatch button2FocusLatch2 = new CountDownLatch(1);

No, `button2FocusLatch` tracks that _Button 2_ gets the initial focus; `button2FocusLatch2` tracks that _Button 2_ gets focus for the second time in case of repeated `KEY_PRESS` event for the <kbd>Tab</kbd> key.

If `button2FocusLatch2` is released, the test fails with a clear error message — _Button 2_ received focus whereas _Button 4_ is expected to have it. If the test continues, it will still fail because _Button 3_ won't get focus but there will be no indication why.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22977#discussion_r1909357529


More information about the client-libs-dev mailing list