On Thu, 16 Jun 2022 15:01:12 GMT, Manukumar V S <[email protected]> wrote:

> java/awt/PopupMenu/PopupMenuLocation.java seems to be unstable in MacOS 
> machines, especially in MacOSX 12 machines. It seems to be a testbug as 
> adding some stability improvements fix the issue. It intermittently fails in 
> CI causing some noise. This test was already problem listed in windows due to 
> an umbrella bug JDK-8238720. I have removed the problem listing and tested it 
> in windows platform also, it works fine there.
> 
> Fix:
> Some stability improvements have been done and the test has been run 100 
> times per platform in mach5 and got full PASS.

test/jdk/java/awt/PopupMenu/PopupMenuLocation.java line 47:

> 45:  * @key headful
> 46:  * @bug 8160270
> 47:  * @run main/timeout=300/othervm -Dsun.java2d.uiScale=1 PopupMenuLocation

Why do you need a "-Dsun.java2d.uiScale=1" option? I do not think it affects 
this test execution in any way.

test/jdk/java/awt/PopupMenu/PopupMenuLocation.java line 77:

> 75: 
> 76:     private static void test(final Point tmp) throws Exception {
> 77:         actionEventReceivedLatch = new CountDownLatch(1);

You set this field on one thread and read on another, some synchronization is 
needed.

test/jdk/java/awt/PopupMenu/PopupMenuLocation.java line 119:

> 117:         final AtomicReference<Point> pt = new AtomicReference<>();
> 118:         SwingUtilities.invokeAndWait(() -> {
> 119:                                           
> pt.set(frame.getLocationOnScreen());

This test uses only awt components which should work on any threads, why 
invokeAndWait is necessary?

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

PR: https://git.openjdk.org/jdk/pull/9187

Reply via email to