RFR: 8206430: Use consistent pattern for startup in FX system tests [v4]

Kevin Rushforth kcr at openjdk.org
Wed Nov 16 20:04:16 UTC 2022


On Wed, 16 Nov 2022 18:29:49 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> 1. Introduced the following utility methods:
>> - Util.launch
>> - Util.shutdown
>> - Util.waitForLatch
>> 2. Fixed the out-of order calls to Stage.hide() and Platform.exit() in many tests' shutdowns.
>> 3. Replaced local waitForLatch copies with Util.waitForLatch
>
> Andy Goryachev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8206430: util startup

tests/system/src/test/java/test/javafx/scene/lighting3D/DirectionalLightTest.java line 67:

> 65:     public static void exit() {
> 66:         Util.shutdown();
> 67:     }

This causes the test to fail. The superclass already does a shutdown, so the subclass must not.

tests/system/src/test/java/test/util/Util.java line 362:

> 360:         try {
> 361:             String msg = "Timeout waiting for FX runtime to start";
> 362:             Assert.assertTrue(msg, startupLatch.await(TIMEOUT, TimeUnit.MILLISECONDS));

I recommend to standardize on 15 seconds like you did for launch (the ones you replaced were mostly a mix of 10 or 15 seconds). Maybe you could create a STARTUP_TIMEOUT constant field?

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

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


More information about the openjfx-dev mailing list