RFR: 8339561: The test/jdk/java/awt/Paint/ListRepaint.java may fail after JDK-8327401

Sergey Bylokhov serb at openjdk.org
Mon Sep 9 07:28:14 UTC 2024


On Wed, 4 Sep 2024 20:50:38 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> Several tests modified by https://github.com/openjdk/jdk/pull/19339 have been tweaked, see inline comments.
> 
> Notes:
>  * We have a few XXXRepaint.java tests and in this patch, I updated all of them to follow the change added to the ListRepaint.java
> 
> @azvegint @aivanov-jdk please take a look.

test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java line 42:

> 40:     private volatile Frame frame, frame2;
> 41:     private volatile Button button, button2;
> 42:     private volatile TextField textField, textField2;

probably unnecessary but some of these fields might be used on different threads, so just in case.

test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java line 55:

> 53:             test.doTest();
> 54:         } finally {
> 55:             EventQueue.invokeAndWait(() -> {

The test should wait until the frame will be disposed.
"invokeLater" was added [here](https://github.com/openjdk/jdk/pull/19339/files#diff-6141b9cfb077259bad37ff9fd15782c5bb31d9c52aadc81a177d9057e177d415R55),

test/jdk/java/awt/List/KeyEventsTest/KeyEventsTest.java line 68:

> 66:         KeyEventsTest app = new KeyEventsTest();
> 67:         try {
> 68:             app.initAndShowGui();

The test was changed [here](https://github.com/openjdk/jdk/pull/19339/files#diff-054074499ab6611e764a315fb13c51af4ad063b07f481e775a2262196077d285R69), the root cause of the failure discussed in https://github.com/openjdk/jdk/pull/19339/files#r1609189736 is a product bug: https://bugs.openjdk.org/browse/JDK-8201307.

test/jdk/java/awt/Paint/ListRepaint.java line 43:

> 41:         for (int i = 0; i < 10; ++i) {
> 42:             try {
> 43:                 EventQueue.invokeLater(ListRepaint::createAndShowGUI);

The purpose of the test is to run some methods of the AWT component on the main thread and check if it will be refreshed on the EDT. It was changed [here](https://github.com/openjdk/jdk/pull/19339/files#r1609190355). It is a product bug: https://bugs.openjdk.org/browse/JDK-8201307.

test/jdk/javax/swing/JButton/bug4490179.java line 85:

> 83:             robot.mousePress(InputEvent.BUTTON3_DOWN_MASK);
> 84:             robot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK);
> 85:             robot.delay(3000);

The test was discussed [here](https://github.com/openjdk/jdk/pull/19339/files#r1609201116). It seems that the purpose of the test is to check that no events will be generated while the left button is pressed, so we should check that "ActionListener" is not triggered and then release the mouse button.
Thoughts?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20861#discussion_r1749635644
PR Review Comment: https://git.openjdk.org/jdk/pull/20861#discussion_r1749633385
PR Review Comment: https://git.openjdk.org/jdk/pull/20861#discussion_r1749639085
PR Review Comment: https://git.openjdk.org/jdk/pull/20861#discussion_r1749645263
PR Review Comment: https://git.openjdk.org/jdk/pull/20861#discussion_r1749647438


More information about the client-libs-dev mailing list