On Mon, 25 Aug 2025 16:56:55 GMT, Damon Nguyen <dngu...@openjdk.org> wrote:

>> Ubuntu machine has multiple failing java awt tests. When looking at the 
>> screenshots of the desktop when each test fails, a white square can be seen 
>> at the top-left of the desktop.
>> 
>> <img width="803" height="344" alt="Screenshot 2025-08-20 at 10 06 37 AM" 
>> src="https://github.com/user-attachments/assets/52d023f6-18ff-46d4-98c4-e2e332ab6a03";
>>  />
>> 
>> This seems to be similar to the white square that `FrameVisualTest.java` 
>> creates so the frame was not disposed of properly during this failure. I 
>> have tried re-creating this failure on Ubuntu 22.04, similar to the failure 
>> OS that this originally occurred on, to no avail. I ran this test 
>> individually, and with all of the listed failing tests back-to-back but all 
>> the tests pass as normal. This stabilization fix to the test attempts to 
>> prevent this in case it occurs again.
>
> Damon Nguyen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Replace setAutoDelay

test/jdk/java/awt/Frame/FrameVisualTest.java line 66:

> 64:             robot.delay(1000);
> 65: 
> 66:             System.out.println("frames.length: " + frames.length);

I suspect that the root cause of this failure is the same as in the 
[JDK-8280987](https://bugs.openjdk.org/browse/JDK-8280987) - spawning a log of 
windows at once, like one or two hundred. This is still happening with the 
updated test in the `createAndShowUI()`.

I guess they should either be shown in batches (of 20 windows, for example) 
with a delay between each batch to give the system time to handle them or the 
number of tested graphics configurations should be reduced.

test/jdk/java/awt/Frame/FrameVisualTest.java line 73:

> 71:                 });
> 72:                 Rectangle rect = new Rectangle(p, d);
> 73:                 BufferedImage img = robot.createScreenCapture(rect);

I am not sure if the current and previous implementations of the test are 
really helpful.

Note the very dark window shadow in the screenshot of the PR description. These 
are the overlapping shadows of multiple windows placed on top of each other.
It seems that at the time of writing, the test expected that the system would 
arrange the windows next to each other, but this is no longer the case.

In the test, we try to get the same bounds for each window because they are 
stacked on top of each other. However, this means that we only check the top 
window multiple times, which is not useful.

I think we should place the windows across the entire screen and take a 
screenshot of each one. Considering there may be many windows, this may need to 
be done in several batches.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26871#discussion_r2298745442
PR Review Comment: https://git.openjdk.org/jdk/pull/26871#discussion_r2298835087

Reply via email to