On Thu, 16 Apr 2020 18:56:21 GMT, Ambarish Rapte <ara...@openjdk.org> wrote:
>> This version doesn't work for me. >> With this change, I get the following error: >> test.javafx.stage.FocusedWindowTest > testLeak FAILED >> junit.framework.AssertionFailedError: Exceeded timeout limit of 10000 >> msec >> at test.util.Util.runAndWait(Util.java:163) >> at test.util.Util.runAndWait(Util.java:134) >> at >> test.javafx.stage.FocusedWindowTest.testLeak(FocusedWindowTest.java:82) > > This is happening because after the last stage is closed JavaFX runtime shuts > down implicitly unless specified > otherwise using `Platform.setImplicitExit(false);`. So `initFX()` should look > as, > ``` > @BeforeClass > public static void initFX() throws Exception { > startupLatch = new CountDownLatch(1); > Platform.startup(startupLatch::countDown); > Platform.setImplicitExit(false); > Assert.assertTrue("Timeout waiting for FX runtime to start", > startupLatch.await(15, TimeUnit.MILLISECONDS)); > } It works now, great! ------------- PR: https://git.openjdk.java.net/jfx/pull/153