JDK-8341041 : [macos15] java/awt/event/KeyEvent/FunctionKeyTest.java test fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 23,24
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2024-09-26
  • Updated: 2024-09-27
  • Resolved: 2024-09-27
Related Reports
Relates :  
Description
java/awt/event/KeyEvent/FunctionKeyTest.java test fails fails on macOS 15 on macos-x64; it passes on macOS aarch64 

I took even the latest fix for the test https://github.com/openjdk/jdk/pull/21013, and the test still fails.

----------System.out:(3/42)----------
frame.windowActivated
e.id=1004
e.id=1005
----------System.err:(28/1538)----------
2024-09-26 16:23:37.659 java[47491:14203359] +[IMKClient subclass]: chose IMKClient_Modern
2024-09-26 16:23:37.659 java[47491:14203359] +[IMKInputSession subclass]: chose IMKInputSession_Modern
Failures detected:
java.lang.Error: F11 key press is not received
java.lang.Error: F11 key release is not received
java.lang.Error: F12 key press is not received
java.lang.Error: F12 key release is not received

java.lang.RuntimeException: Test failed: F11 key press is not received
        at FunctionKeyTest.main(FunctionKeyTest.java:127)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:573)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:1576)
Caused by: java.lang.Error: F11 key press is not received
        at FunctionKeyTest.testKey(FunctionKeyTest.java:72)
        at FunctionKeyTest.main(FunctionKeyTest.java:108)
        ... 4 more
Caused by: java.util.concurrent.TimeoutException
        at java.base/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:259)
        at java.base/java.util.concurrent.CyclicBarrier.await(CyclicBarrier.java:437)
        at FunctionKeyTest.testKey(FunctionKeyTest.java:69)
        ... 5 more

JavaTest Message: Test threw exception: java.lang.RuntimeException: Test failed: F11 key press is not received
JavaTest Message: shutting down test
Comments
After disabling all the keyboard setting under "Mission Control" the test passed.
27-09-2024

[~landrews] [~mvs] Could you verify that pressing F11 doesn't show desktop on the hosts with macOS 15 where you run the tests? It looks F11 is one of the global shortcuts in macOS. Today I happened to run `FunctionKeyTest.java` on macOS 14.x; as soon as the robot pressed the F11 key, all the windows were moved out of the way to reveal the desktop. Indeed, the same happens whenever I press F11 on my Mac with macOS 14.x. I didn't disable the standard macOS shortcuts though.
27-09-2024

The bug should be owned by the dev team — it's a failure on a new platform, namely macOS 15. According to the log, neither F11 nor F12 key presses / releases are received. The problem could be outside of JDK.
27-09-2024