On Wed, 22 May 2024 20:49:44 GMT, Phil Race <p...@openjdk.org> wrote:

>> test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java line 48:
>> 
>>> 46:     boolean actionPerformed = false;
>>> 47:     Object actionLock = new Object();
>>> 48:     static final int ATTEMPTS = 10;
>> 
>> Each attempt sleeps for 3 seconds, so 50 attempts is way too many and 
>> exceeds the default test timeout.
>
> OK. But I'm not seeing how this change helps the test pass.

It does not, but when the test does fail, it takes ages to fail.
(e.g. if we are missing some env variable which we are rely on to disable 
system tray support when it is 
[needed](https://bugs.openjdk.org/browse/JDK-8322750)).

>> test/jdk/javax/swing/JButton/bug4490179.java line 57:
>> 
>>> 55:                 frame.getContentPane().add(button);
>>> 56:                 button.addActionListener(e -> {
>>> 57:                     if ((e.getModifiers() & InputEvent.BUTTON1_MASK)
>> 
>> This check was lost for some reason during the open sourcing of the original 
>> test, so restored.
>
> Interesting. So since this was unconditionally setting "passed=false" how has 
> the test been passing ?

The action listener should be triggered when we release the Button1, and there 
was no such release in this test.
And we didn't wait long enough after that anyway, so it might pass even if it 
fails.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19339#discussion_r1610682431
PR Review Comment: https://git.openjdk.org/jdk/pull/19339#discussion_r1610694150

Reply via email to