On Sat, 7 Nov 2020 06:55:09 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

> This test rarely fails in the past on some configurations but was never a 
> problem listed, and according to the history of CI, it fails 2 times on its 
> own this year.
> 
> There are two possible reasons for the failure:
> 1. At that time we had a memory leak, which was fixed.
> 2. The test works too fast and it was not enough time for GC to eliminate 
> 1000 windows.
> 
> To make the future evaluation simpler I enhanced the test and make it 
> stricter, see some comments inline.

test/jdk/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java line 74:

> 72:         for (WeakReference<Window> ref : children)
> 73:         {
> 74:             while (ref.get() != null) {

Will wait till the end of the test and log what window is leaked. If it fails 
then it will be 100% product bug.

test/jdk/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java line 92:

> 90:         }
> 91:         catch (Exception z)
> 92:         {

If the field will be removed/renamed the test should be reworked.

test/jdk/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java line 87:

> 85:         while (ownersChildren.size() > 0)
> 86:         {
> 87:             System.out.println("ownersChildren = " + ownersChildren);

This private list is cleared via the DIsposer mechanism, which may require 
additional time. If it fails then it will be 100% product bug.

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

PR: https://git.openjdk.java.net/jdk/pull/1105

Reply via email to