RFR: 8296919: Make system tests that detect memory leaks more robust by using JMemoryBuddy utility [v4]

Andy Goryachev angorya at openjdk.org
Thu May 4 15:33:29 UTC 2023


On Thu, 4 May 2023 12:05:45 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> Lukasz Kostyra has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update javafx.web classpath to include JMemoryBuddy
>
> tests/system/src/test/java/test/javafx/embed/swing/SwingNodeMemoryLeakTest.java line 80:
> 
>> 78:         });
>> 79: 
>> 80:         SwingUtilities.invokeAndWait(() -> Util.sleep(500));
> 
> Sleeping on either the JavaFX Application thread or the Swing EDT (as in this case) is not generally desirable. What is the sleep trying to achieve? Is there a better way, possibly sleeping on the test thread and then doing a `SwingUtilities.invokeAndWait` (maybe with a no-op runnable? not sure)?.

I can't believe I missed that!
I wonder if we could use CountDownLatch instead here and use Util.await(CountDownLatch) or something like that.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1121#discussion_r1185197255


More information about the openjfx-dev mailing list