MenuDoubleShortcutTest > nonMacMenuBarComesBeforeScene(on linux) & MenuDoubleShortcutTest > macSceneComesBeforeMenuBar(on macOS) fail intermittently.
In every failure we can see that no Accelerator event in fired `Key press event triggered no actions`. To initiate accelerator event we use `testKey()` method in this test. `testKey()` method uses asynchronous `Platform.runLater()` to press accelerator shortcut. We have 100ms delay after this asynchronous event to check whether accelerators events are fired, but this is not fool-proof. So this test is updated to make sure the asynchronous event in `testKey()` is completed by using a `CountDownLatch`. Also i tried removing the delay that we have after `testKey()` call, but it looks like 100ms delay is still needed between keyPress and event callbacks. Updated test is run 50 times on all platforms and there no intermittent failures seen. ------------- Commit messages: - Add explicit latch to make sure runLater is honoured Changes: https://git.openjdk.org/jfx/pull/1906/files Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1906&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8364405 Stats: 5 lines in 1 file changed: 3 ins; 2 del; 0 mod Patch: https://git.openjdk.org/jfx/pull/1906.diff Fetch: git fetch https://git.openjdk.org/jfx.git pull/1906/head:pull/1906 PR: https://git.openjdk.org/jfx/pull/1906