JDK-8266047 : [TEST_BUG] bug8033699.java fails when run in group
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8u281,17
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2021-04-27
  • Updated: 2022-05-17
  • Resolved: 2022-04-19
Related Reports
Relates :  
Relates :  
Relates :  
Description
The test javax/swing/JRadioButton/8033699/bug8033699.java fails regularly when run in a group of tests:

jdk-dev> ./build/jdk-17/bin/java -jar ../jtreg/lib/jtreg.jar -nr -v -a -ignore:quiet -w:build/jtwork -r:build/jtreport open/test/jdk/java/awt/Focus/FocusTransitionTest/FocusTransitionTest.java open/test/jdk/java/awt/Focus/FocusTraversalPolicy/{DefaultFTPTest.java,InitialFTP.java,LayoutFTPTest.java} open/test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java

...
runner starting test: javax/swing/JRadioButton/8033699/bug8033699.java
runner finished test: javax/swing/JRadioButton/8033699/bug8033699.java
Failed. Execution failed: `main' threw exception: java.lang.reflect.InvocationTargetException
Test results: passed: 4; failed: 1

In this case, it seems the frame of the test is not activated because, after jtreg exists, I hear a bell and prompt in the console:
Display all ### possibilities? (y or n)

That is the Tab key press generated by the Robot in the test is sent to Cygwin Terminal rather than the test frame. It's the reason why the test fails.

When the test is run on its own or in another sequence of tests, it passes.
Comments
The tests pass successfully in CI and on a correctly configured system. “Windows defaults to some delays in focus transfer which will cause many test failures.” This causes issues to tests which use Robot to send keyboard input. The ForegroundLockTimeout parameter under HKEY_CURRENT_USER\Control Panel\Desktop has to be set to 0 (the type is REG_DWORD). https://wiki.openjdk.java.net/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements
19-04-2022