RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs
Harshitha Onkar
honkar at openjdk.org
Mon Dec 2 18:52:40 UTC 2024
On Mon, 2 Dec 2024 17:12:53 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:
> The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability.
> This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed.
>
> - java/awt/datatransfer/Independence/IndependenceAWTTest.java
> - java/awt/datatransfer/Independence/IndependenceSwingTest.java
>
> Multiple runs of the test on CI looks good and the tests pass.
So what, exactly, is the part of all these changes that fixes the instability of these tests ?
After JEP486 Removal of SecurityManager, looks like the tests are running faster. Following are the changes made to stabilize the test.
- Added invokeAndWait() when creating testUI.
- Moved the testUI to center.
- Reduced delays and removed unnecessary waitForIdle() calls between mousePress and mouseRelease.
test/jdk/java/awt/datatransfer/Independence/IndependenceSwingTest.java line 67:
> 65: robot = new ExtendedRobot();
> 66:
> 67: SwingUtilities.invokeAndWait(IndependenceSwingTest::createAndShowUI);
Added invokeAndWait() during test UI creation.
test/jdk/java/awt/datatransfer/Independence/IndependenceSwingTest.java line 151:
> 149: robot.waitForIdle(1000);
> 150: frame.setLocation(100, 100);
> 151: robot.waitForIdle(1000);
Calling frame.setLocation() looked redundant since we are already positioning it in createAndShowUI. Removed unnecessary waitForIdle() + delay() calls.
test/jdk/java/awt/datatransfer/Independence/IndependenceSwingTest.java line 170:
> 168: center.translate(tf1.getWidth() / 2, tf1.getHeight() / 2);
> 169: ttf1Center = center;
> 170: });
Wrapped in invokeAndWait()
test/jdk/java/awt/datatransfer/Independence/IndependenceSwingTest.java line 189:
> 187: robot.mouseMove(ttf1Center.x + 15, ttf1Center.y);
> 188: robot.mouseRelease(MouseEvent.BUTTON1_DOWN_MASK);
> 189: robot.waitForIdle(500);
Removed unnecessary robot.waitForIdle() calls between mousePress and mouseRelease() and reduced delays
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22490#issuecomment-2512430525
PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866396846
PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866400665
PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866401288
PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866405148
More information about the client-libs-dev
mailing list