JDK-6823915 : java/awt/Toolkit/RealSync/Test.java test failed just against SLES11 on 6u14b03
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u14,7u60,7u79,8,9
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: linux_suse_sles_11,os_x
  • CPU: x86
  • Submitted: 2009-03-30
  • Updated: 2019-12-17
  • Resolved: 2019-12-17
Related Reports
Relates :  
Relates :  
Description
6u14b03 was tested on new SLES11 x86 system for a baseline. The named test case from a relevant 6u14b03 (test_j2se) Workspace failed just on this system and passed on the others Linux version that used (SLES10, SLES9, RHEL5, RHEL4, Solaris10_x86, WindowsXP). 

The following issue messages appeared in execution. 

"..
----------System.err:(37/5681)*----------
Test failed: testType
Cause: Wrong text: 
Cause: - Focus owner: java.awt.TextField[textfield0,3,24,194x173,text=,editable,selection=0-0]
Cause: - Focused window: java.awt.Frame[frame0,100,100,200x200,layout=java.awt.BorderLayout,title=testType,resizable,normal]
Events:
java.awt.event.ContainerEvent[COMPONENT_ADDED,child=textfield0] on frame0
java.awt.event.ComponentEvent[COMPONENT_RESIZED (100,100 200x200)] on frame0
java.awt.event.ComponentEvent[COMPONENT_MOVED (100,100 200x200)] on frame0
java.awt.event.ComponentEvent[COMPONENT_RESIZED (3,24 194x173)] on sun.awt.X11.XTextFieldPeer$XAWTTextField[,3,24,194x173,invalid,hidden,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@19f3736,flags=297,maximumSize=,minimumSize=,preferredSize=,caretColor=java.awt.SystemColor[i=13],disabledTextColor=javax.swing.plaf.ColorUIResource[r=128,g=128,b=128],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=java.awt.SystemColor[i=12],selectionColor=java.awt.SystemColor[i=13],columns=0,columnWidth=0,command=,horizontalAlignment=LEADING,echoChar=\u0000]
.."

The full log file is attached. 

Please look in this issue to sort out if it's a particularity of a new platform.
See the Comments
The CR 6438721 has been submitted about the same failure on Solaris 10. It's very unlikely that it's a new platform-specific issue. Is it always reproducible failure?
The failure is always reproducible on SLES11 x86 and it's passing on the others linux System I've mentioned above. It passed yesterday for me on Solaris 10 x86  I've used in one of automatic reruns that is implemented just for the failed/unstable tests. We use this mode for some awt/swing related tests that may need a several attempts to rerun to get passed, that's why I've mentioned earlier that it passed for me on Solaris10 and WindowsXP as well. Seems it was just a lucky case. It was failing on Solaris 10 (x86, sparc) today all the time. I just can put more automatic reruns to get it passed on Solaris10 in some attempt to know what kind of randomness might be as a cause. In anyway it does not look stable on Solaris. The issue message looks quite similar to CR 6438721 on Solaris with a minor distinctions that appear in each rerun as below

 "  48  ----------System.err:(50/4911)----------
    49  Test failed: testFocus2
    50  Cause: B1 couldn't get focus
    51  Cause: - Focus owner: null
    52  Cause: - Focused window: null
    53  Events:

    48  ----------System.err:(31/2326)----------
    49  Test failed: testPress
    50  Cause: Not pressed
    51  Cause: - Focus owner: null
    52  Cause: - Focused window: null

    48  ----------System.err:(43/8778)----------
    49  Test failed: testPressSwing
    50  Cause: Not pressed
    51  Cause: - Focus owner: javax.swing.JButton[,73,5,41x26,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@cf710e,flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=b,defaultCapable=true]" 

Again the issue for SLES11 look a little different as well at this point, as it was mentioned earlier.
Just let you know that the test passed for me on Solaris 10 x86 (I guess the same would be for Solaris sparc) with the expected message below after I put more automatic reruns in the configuration (but it a matter of luck it passed in the initial iteration). 

"   59  elapsed time (seconds): 114.232
    60  ----------System.out:(0/0)----------
    61  ----------System.err:(2/50)----------
    62  Total results: ALL TESTS PASSED!!!
    63  STATUS:Passed.
    64  result: Passed. Execution successful"

I assume it's a timing issue in the test code and it might need more sleep before go for some next method invocation in the runtime especially if "gc() & robot.mouseMove(loc.x+30, loc.y+40)" are explicitly used in processing.

Comments
EVALUATION The changes below fixes the failure. <code> ------- Test.java ------- *** /tmp/sccs.xuwOms 2009-04-15 19:52:30.000000000 +0400 --- Test.java 2009-04-15 19:45:53.000000000 +0400 *************** *** 1,7 **** /* ! @test %W% %E% @bug 6252005 @summary Tests that realSync feature works @author denis.mikhalkin: area=awt.toolkit @run main/timeout=6000 Test */ --- 1,7 ---- /* ! @test @(#)Test.java 1.4 05/08/09 @bug 6252005 @summary Tests that realSync feature works @author denis.mikhalkin: area=awt.toolkit @run main/timeout=6000 Test */ *************** *** 191,200 **** --- 191,201 ---- b.requestFocus(); realSync(f); asser(b.isFocusOwner(), "Couldn't focus text field"); robot.keyPress(KeyEvent.VK_A); + robot.delay(10); robot.keyRelease(KeyEvent.VK_A); realSync(f); asser("a".equals(b.getText()), "Wrong text: " + b.getText()); f.dispose(); } *************** *** 214,223 **** --- 215,225 ---- b.requestFocus(); realSync(f); asser(b.isFocusOwner(), "Couldn't focus text field"); robot.keyPress(KeyEvent.VK_A); + robot.delay(10); robot.keyRelease(KeyEvent.VK_A); realSync(f); asser("a".equals(b.getText()), "Wrong text: " + b.getText()); f.dispose(); } *************** *** 241,250 **** --- 243,253 ---- Point loc = b.getLocationOnScreen(); events.add("Pressing at " + loc); robot.mouseMove(loc.x+3, loc.y+3); pressed = false; robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(10); robot.mouseRelease(InputEvent.BUTTON1_MASK); realSync(f); asser(pressed, "Not pressed"); f.dispose(); } *************** *** 267,276 **** --- 270,280 ---- Point loc = b.getLocationOnScreen(); events.add("Pressing at " + loc); robot.mouseMove(loc.x+3, loc.y+3); pressed = false; robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(10); robot.mouseRelease(InputEvent.BUTTON1_MASK); realSync(f); asser(pressed, "Not pressed"); f.dispose(); } </code> However, another failure appears: Test failed: testFocus0 java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at Test.run(Test.java:91) at Test.main(Test.java:55) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:78) at java.lang.Thread.run(Thread.java:619) Caused by: sun.awt.SunToolkit$InfiniteLoop at sun.awt.SunToolkit.realSync(SunToolkit.java:1611) at Test.realSync(Test.java:367) at Test.testFocus0(Test.java:291) ... 11 more This is an internal exception of the RealSync mechanism. Behavior of underlying platform could couse it. But anyway it doesn't consern the functionality of AWT. So, the failure shouldn't be treated as critical for updates.
29-04-2009

EVALUATION This looks like a timings issue. The test fails at the following place: robot.keyPress(KeyEvent.VK_A); robot.keyRelease(KeyEvent.VK_A); realSync(f); asser("a".equals(b.getText()), "Wrong text: " + b.getText()); Although there is 'realSync' here, the first line is not affected, so I'd guess the test fails just because robot releases VK_A too fast... I wonder if there are any differences between SLES11 and previous SLES versions in keyboard timeouts.
01-04-2009