RFR: 8285503: SwingNodeDnDMemoryLeakTest::testSwingNodeMemoryLeak fails sometimes

Ajit Ghaisas aghaisas at openjdk.org
Mon Nov 14 07:01:42 UTC 2022


On Thu, 10 Nov 2022 12:01:53 GMT, Ajit Ghaisas <aghaisas at openjdk.org> wrote:

> Root cause: The test unreliability comes from the 250ms sleep between `System.gc()` calls.
> Other system tests such as `TabPaneHeaderLeakTest`, `AccordionTitlePaneLeakTest` and `ShapeViewOrderLeakTest` etc sleep for 500ms between `System.gc()` calls.
> 
> Fix:
> - Increased the sleep time to 500ms between `System.gc()` calls.
> - Reduced the number of SwingNodes by half as an additional step towards making the test lighter.
> 
> Testing: This test used to fail on my macBook all the time if ran as part of a full system test run. I executed full test runs 5 times with above changes and no failure was observed.

> I verified that the test always fails on my Mac without your fix, and passes with your fix (I ran it in a loop 20 times with the number of swing nodes reverted back to 10). So this simple fix is fine, and as you note, brings this test in line with other tests that manually check for leaks. I still think we could make all of our memory leak tests more robust by using JMemoryBuddy. Can you file a follow-up bug to do that?


Filed [JDK-8296919](https://bugs.openjdk.org/browse/JDK-8296919) for this.

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

PR: https://git.openjdk.org/jfx/pull/946


More information about the openjfx-dev mailing list