JDK-6831914 : [TEST_BUG] Reg: java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogTest/EnqueueWithDialogTest.html fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u14,7,8u25
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2009-04-20
  • Updated: 2014-09-18
  • Resolved: 2014-03-27
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 8
8-poolResolved
Related Reports
Duplicate :  
Relates :  
Description
Reg-test java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogTest/EnqueueWithDialogTest.html
fails in windows with the following exception in pit6u14b05 build. Passes with 6u14b04 build. (Also attached is the .jtr file)

java.lang.RuntimeException: Type-ahead doesn't work
	at EnqueueWithDialogTest.start(EnqueueWithDialogTest.java:131)
	at com.sun.javatest.regtest.AppletWrapper$AppletThread.run(AppletWrapper.java:145)
	at java.lang.Thread.run(Thread.java:619)
STATUS:Failed.Applet thread threw exception: java.lang.RuntimeException: Type-ahead doesn't work
java.awt.FocusEvent[FOCUS_LOST,temporary,opposite=null,cause=ACTIVATION] on java.awt.Dialog[dialog0,0,0,112x27,layout=java.awt.BorderLayout,APPLICATION_MODAL,title=dialog]
result: Failed. Execution failed: Execution failed

Comments
RULE closed/java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogTest/EnqueueWithDialogTest Exception java.lang.RuntimeException: Type-ahead doesn't work
18-09-2014

Passed 10 times on Windows 7 with JDK8 b132.
27-03-2014

SUGGESTED FIX +++ b/java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogTest/EnqueueWithDialogTest.java Wed Mar 09 18:51:12 2011 +0300 @@ -73,7 +73,6 @@ public void actionPerformed(ActionEvent e) { System.err.println(e.toString()+","+e.getWhen()); System.err.println("B pressed"); - robotSema.raise(); EventQueue.invokeLater(new Runnable() { public void run() { @@ -83,6 +82,7 @@ } }); + robotSema.raise(); // This will cause enqueue the following key events d.setVisible(true); }
10-03-2011

EVALUATION An execution sequence look like: Applet-thread EDT | | A1) press-release E1) robotSema.notify() A2) robotSema.wait() E2) invokeLater on {waitTillShown(d); d.toFront()} A3) press-release E3) dialog.show() A4) pressSema.wait() E4) pressSema.notify() The logic here is as follows: robot triggers action event on Button and then blocks AppletMain thread with wait(). That action event notifies the robotSemaphore and then posts some code with invokeLater() and then shows the dialog. If robotSemaphore notified fast enough then the robot bursts press-release even earlier the dialog becomes visible. So far all keyevents has come to the button instead of just appeared dialog. I don't see an easy way to make things going right in 100% cases but I'd move robotSema.notify() in between E2) and E3). This wouldn't change the test's logic but increases the chance of passing the test in my environment.
10-03-2011

EVALUATION In jdk7 (latest build) the test works fine on Windows 7. Seems like XP-specific issue.
02-03-2011

EVALUATION Reproduced with jdk6 and jdk7. Looks like a thread race as I had to try it several times to get the failure.
18-08-2010