JDK-8169475 : WheelModifier.java fails by timeout
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8,9,17,21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux,windows
  • CPU: x86_64
  • Submitted: 2016-11-09
  • Updated: 2024-01-22
  • Resolved: 2023-10-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 21 JDK 22 JDK 8
11.0.23-oracleFixed 17.0.11-oracleFixed 21.0.3-oracleFixed 22 b22Fixed 8u411Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) Client VM (build 25.51-b03, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]

A DESCRIPTION OF THE PROBLEM :
The test java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java fails by time out on Windows.
This issue was not observed on Linux, OSX


ERROR MESSAGES/STACK TRACES THAT OCCUR :
#section:main
----------messages:(7/254)----------
command: main WheelModifier
reason: Assumed action based on file name: run main WheelModifier 
Mode: othervm
Timeout information:
Could not find process id for the process that timed out.
Skipping timeout handling.
elapsed time (seconds): 240.022

REPRODUCIBILITY :
This bug can be reproduced always.


Comments
Fix request [11u] I backport this for parity with 11.0.23-oracle. No risk, only tests change. Clean backport. Test passes. SAP nightly testing passed.
22-01-2024

Fix request [17u] I backport this for parity with 17.0.11-oracle. No risk, only tests change. Clean backport. Test pass. SAP nightly testing passed.
22-01-2024

Fix request [21u] I backport this for parity with 21.0.3-oracle. No risk, only a test change. Clean backport. SAP nightly testing passed.
22-01-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/190 Date: 2024-01-18 02:10:39 +0000
18-01-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/2461 Date: 2024-01-17 09:06:03 +0000
17-01-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/2134 Date: 2024-01-17 09:00:27 +0000
17-01-2024

Changeset: 613d32c2 Author: Renjith Kannath Pariyangad <renjith.kannath.pariyangad@oracle.com> Committer: Alexey Ivanov <aivanov@openjdk.org> Date: 2023-10-31 18:20:22 +0000 URL: https://git.openjdk.org/jdk/commit/613d32c2822a443fdcb131a7d67c528410e9f7e6
31-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16281 Date: 2023-10-20 06:59:17 +0000
20-10-2023

Fix: [~rkannathpari] is working on updating the test. An additional CountDownLatch is added to wait for ‘focusGained’ event. It's followed by Robot.waitForIdle() and SunToolkit.realSync(). (The latter is for 8u only because waitForIdle uses realSync internally in later versions.) Then the test logic is executed. Renjith is also replacing unconditional waits — await() — with timed waits — await(1, TimeUnit.SECONDS). It makes the fail quickly without waiting for jtreg timeout which is 5 minutes by default.
19-10-2023

Root cause (for 8u): The test times out because presses mouse button before UI is shown on the screen. ~/dev/tests/jdk1.8.0_401/bin/java -cp ./build WheelModifier 1,697,216,092,894 - windowOpened 1,697,216,093,006 - # Started 1,697,216,093,027 - Got location and size sLoc: java.awt.Point[x=105,y=69] bSize: java.awt.Dimension[width=129,height=25] 1,697,216,093,027 - Going to press: 169, 81 1,697,216,093,141 - Pressed - waiting for latch 1,697,216,093,386 - windowActivated 1,697,216,093,410 - windowGainedFocus The number is System.currentTimeMillis() formatted with group separator. This is why adding a delay resolves the problem. It's also because waitForIdle() in 8u is not realSync(). In fact, the test does not work correct without using realSync().
19-10-2023

The test consistently fails on Linux when run with the latest build of 8u. So the test may need specially crafted updates for 8u.
13-10-2023

I ran many test jobs today in CI but I cannot reproduce failure, not at least once out of more than 40 runs with JTREG_TEST_REPEAT=50. Yet the test could be improved: fb.getLocationOnScreen() and fb.getSize() are to be called on EDT. I'd rather not add the additional delay just yet, at least to mainline, 21u, 17u and 11u. Java 8u is a different story though. Robot.waitForIdle is not realSync, it does not provide the same guarantees. For 8u, we probably need to replace the usage of waitForIdle() with realSync(). If there are still failures, add an additional delay.
12-10-2023

The test is still intermittently failing on 17, 21, 22. The failure was observed on Ubuntu-20.04, Ubuntu-22.04, Windows 11 on both platforms x86-64, aarch64
17-09-2023

According to the messages and the stack dump, the test on Linux is waiting for the first event. "MainThread" #11 prio=5 os_prio=0 tid=0x00007f079013f000 nid=0x25c9 waiting on condition [0x00007f07534f2000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00000000f5772620> (a java.util.concurrent.CountDownLatch$Sync) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at … at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231) at WheelModifier.run(WheelModifier.java:105) at WheelModifier.main(WheelModifier.java:131) at … Additional delay after robot.waitForIdle() could resolve the failure.
07-01-2022

Recently, the test consistently fails on Linux in 8u. There are only several failures on Windows. The test fails in jdk-dev too, on Linux and Windows, yet not as often.
06-01-2022

Issue is reproducible with JDK8u231b01 on Ubuntu machines. Logs : http://llg00gql.uk.oracle.com:9504/runs/02464/2464524.ManualSubmit/2464524.ManualSubmit-1/workDir/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.jtr RULE "java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java" Exception java.lang.Thread.State: WAITING (on object monitor) RULE "java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java" Exception java.lang.Thread.State: WAITING (parking) RULE "java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java" StatusError Program `...java' timed out (timeout set to ...ms, elapsed time including timeout handling was ...ms).
01-07-2019

Reproduced with java/awt group test in windows environment - attached the error log. JDK9 build 142 - JDK9_build142_WheelModifier_error_log.txt JDK8 build132 - JDK8_build132_WheelModifier_error_log.txt
11-11-2016

does it affect 9?
09-11-2016

Source Code : http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/f7be58eb30bc/test/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java
09-11-2016