RFR: 8296919: Make system tests that detect memory leaks more robust by using JMemoryBuddy utility [v5]
Kevin Rushforth
kcr at openjdk.org
Fri May 5 12:30:21 UTC 2023
On Fri, 5 May 2023 10:37:23 GMT, Lukasz Kostyra <lkostyra at openjdk.org> wrote:
>> Verified these changes on all platforms and saw no abnormalities in test execution.
>>
>> This change is based on a preliminary patch done by @aghaisas , with some minor changes and the addition of one Leak-related web test. EventListenerLeak test was not touched, as it is a separate manual test app instead of a JUnit test.
>
> Lukasz Kostyra has updated the pull request incrementally with two additional commits since the last revision:
>
> - JMemoryBuddy: Add javadoc comments
> - Remove thread sleeps before JMemoryBuddy calls
>
> JMemoryBuddy performs sleeps to check if objects are collectable by
> itself, there is no reason to do those.
I saw a one-time failure that suggests waiting for the EDT to run something, and possibly a sleep, might still be needed.
tests/system/src/test/java/test/javafx/embed/swing/SwingNodeMemoryLeakTest.java line 80:
> 78: });
> 79:
> 80: JMemoryBuddy.assertCollectable(weakRefArrSN);
On my Mac (MacBook Pro x64 running macOS 13.2.1) I saw a one-time test failure here. So there might be a need to wait for the EDT to at least do something, possibly followed by a sleep (on the test thread, not on the EDT).
-------------
PR Review: https://git.openjdk.org/jfx/pull/1121#pullrequestreview-1414685123
PR Review Comment: https://git.openjdk.org/jfx/pull/1121#discussion_r1186027809
More information about the openjfx-dev
mailing list