JDK-8278348 : [macos12] javax/swing/JTree/4908142/bug4908142.java fails in macos12
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 15,17,18,19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64,aarch64
  • Submitted: 2021-12-07
  • Updated: 2022-10-13
  • Resolved: 2022-05-12
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 19 JDK 8
11.0.17-oracleFixed 17.0.5-oracleFixed 19 b23Fixed 8u351Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8278459 :  
JDK-8278580 :  
Description
The following test failed in the JDK18 CI:

javax/swing/JTree/4908142/bug4908142.java

Here's a snippet from the log file:

#section:main
----------messages:(5/182)----------
command: main bug4908142
reason: User specified action: run main bug4908142 
Mode: othervm
Additional options from @modules: --add-modules java.desktop
elapsed time (seconds): 5.737
----------configuration:(3/40)----------
Boot Layer
  add modules: java.desktop

----------System.out:(0/0)----------
----------System.err:(11/657)----------
java.lang.Error: The selected index should be "aad", but not ade
	at bug4908142.main(bug4908142.java:96)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:833)

JavaTest Message: Test threw exception: java.lang.Error: The selected index should be "aad", but not ade
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.Error: The selected index should be "aad", but not ade
----------rerun:(42/6550)*----------
Comments
8u-na. Same for 8u.
13-10-2022

11u-na, 17u-na: Removes tests from ProblemList that are not listed in 11u/17u
11-10-2022

Changeset: be97b4bc Author: Prasanta Sadhukhan <psadhukhan@openjdk.org> Date: 2022-05-12 09:25:42 +0000 URL: https://git.openjdk.java.net/jdk/commit/be97b4bc83d4d3b2edfe6d9157a8d5bc079bdade
12-05-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/8532 Date: 2022-05-04 11:16:17 +0000
04-05-2022

So the updated ProblemList fix (JDK-8284924) did not work for Mac_OS_X_12.1. Sigh...
16-04-2022

The updated ProblemList fix (JDK-8284924 ) is in jdk-19+19-1240.
16-04-2022

[~dcubed]it seems you had problemlisted these 2 closed test also so why it is being run? As I see, you had problemlisted in this manner where you specified os version which seem to not working javax/swing/JList/4908142/bug4908142.java 8278265,8278348 macosx-12.0.1,macosx-12.1,macosx-12.2,macosx-12.2.1 Guess you will like to specify "macos-all"
15-04-2022

More than a year later as it's on a new macos version osx12.. It fails in 12.0.1, 12.2 as of now... Maybe that CGEventSourceRef source = CGEventSourceCreate(kCGEventSourceStateHIDSystemState); is handled differently in new macos version. I have already proved (by mach5 jobs in confidential comment) it's a regression of JDK-8242174 and without that fix, it works consistently. Also, JDK-8273573 is also affected by that fix..
16-03-2022

Not sure how it could be a regression of JDK-8242174 since the current issue was reported more than a year later. If some code works slowly then you should report this to apple providing a native test case. But taking into account that the problem is reproduced on the old version of macOS and works fine on the new one - the bug could be fixed already, I suggest just to update the systems and close this bug.
16-03-2022

Since it's an aftereffect/regression of JDK-8242174 and also being awt issue, not sure on the remedy here, assigning to author for future course of action.
11-03-2022

[~prr] - The screen1.png files for the latest pair of failures is showing no signs of anything open on the desktop. Both of the most recent failures have happened on the same machine.
02-03-2022

It seems to be a regression/aftereffect of JDK-8242174: [macos] The NestedModelessDialogTest test make the macOS unstable specially introduction of CGEventSourceRef source = CGEventSourceCreate(kCGEventSourceStateHIDSystemState); which seems to take upto 3secs in macos12 at certain times like this where there are repeated keys ---------System.err:(65/6199)---------- 2022-01-11 17:41:01.327 java[2487:147078] java keyCode 41 keyPressed 1 2022-01-11 17:41:01.327 java[2487:147078] Before autoDelay CFAbsoluteTimeGetCurrent 663615661.327149 2022-01-11 17:41:01.327 java[2487:147078] After autoDelay CFAbsoluteTimeGetCurrent 663615661.327190 2022-01-11 17:41:01.327 java[2487:147053] CGEventSourceCreate 0x6000038cb300, CFAbsoluteTimeGetCurrent 663615661.327363 2022-01-11 17:41:01.327 java[2487:147053] CGkeyCode 0 CFAbsoluteTimeGetCurrent 663615661.327490 2022-01-11 17:41:01.327 java[2487:147053] CGEventCreateKeyboardEvent CFAbsoluteTimeGetCurrent 663615661.327705 2022-01-11 17:41:01.327 java[2487:147053] CGEventPost CFAbsoluteTimeGetCurrent 663615661.327763 2022-01-11 17:41:01.327 java[2487:147053] After CFRelease CFAbsoluteTimeGetCurrent 663615661.327788 2022-01-11 17:41:01.327 java[2487:147078] After performOnMainThreadWaiting CFAbsoluteTimeGetCurrent 663615661.327830 2022-01-11 17:41:01.386 java[2487:147078] java keyCode 41 keyPressed 0 2022-01-11 17:41:01.386 java[2487:147078] Before autoDelay CFAbsoluteTimeGetCurrent 663615661.386578 2022-01-11 17:41:01.386 java[2487:147078] After autoDelay CFAbsoluteTimeGetCurrent 663615661.386626 2022-01-11 17:41:04.381 java[2487:147053] CGEventSourceCreate 0x6000038c8660, CFAbsoluteTimeGetCurrent 663615664.381792 <========= 2022-01-11 17:41:04.381 java[2487:147053] CGkeyCode 0 CFAbsoluteTimeGetCurrent 663615664.381915 2022-01-11 17:41:04.381 java[2487:147053] CGEventCreateKeyboardEvent CFAbsoluteTimeGetCurrent 663615664.381961 2022-01-11 17:41:04.382 java[2487:147053] CGEventPost CFAbsoluteTimeGetCurrent 663615664.382031 2022-01-11 17:41:04.382 java[2487:147053] After CFRelease CFAbsoluteTimeGetCurrent 663615664.382064 2022-01-11 17:41:04.382 java[2487:147078] After performOnMainThreadWaiting CFAbsoluteTimeGetCurrent 663615664.382127
20-01-2022

The latest failure on macosx-x64 does not contain a pop-up of any kind. I'm going to look at ProblemListing this test on macosx-x64.
11-12-2021

The latest sighting happened on a test machine where screen1.png shows a clear desktop except for the macOS dock. [~tbell] and [~psadhukhan] - I'm no longer convinced that the open "System Preferences" dialog has anything to do with this failure mode. We have now had 4 sightings in two days. The JDK18 code fork is tomorrow so I don't think this issue is going to be tracked down before that deadline. I'm going to look at ProblemListing this test on macosx-aarch64.
08-12-2021

[~tbell] - The third sighting is on a different test machine, but again there is a "System Preferences" dialog open on the desktop. Any idea what the heck is going on with these test machines?
08-12-2021

The second sighting is for the same test machine and the screenshot shows the System Preferences dialog open.
07-12-2021

Seems like some Notification system dialog is open (attached screenshot from failure handler) which has taken the focus from the test so key events are not delivered properly.
07-12-2021

The fix for the following bug: JDK-8172065 javax/swing/JTree/4908142/bug4908142.java The selected index should be "aad" is in jdk-18+27-1872 and this latest failure was spotted in jdk-18+27-1885-tier4.
07-12-2021