RFR: 8274597: [TESTBUG] Two of the dnd tests times out and fails

Manukumar V S mvs at openjdk.java.net
Fri Oct 1 08:27:34 UTC 2021


On Thu, 30 Sep 2021 20:17:57 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> These two dnd tests fails most of the time with a time out, mostly noticed in windows 11 machines.
>> 1. java/awt/dnd/AcceptDropMultipleTimes/AcceptDropMultipleTimes.java
>> 2. java/awt/dnd/DropTargetEnterExitTest/MissedDragExitTest.java
>> 
>> Fix:
>> From the logs, I have noticed that some of the non-daemon threads are still waiting even after the test execution is complete. So it could be possible that java is waiting for these threads to be finished execution before the main thread exits.
>> As a fix for this, I have put a Thread.sleep(100) at the end of the main() in order to enable other non-daemon threads get a chance to finish their execution before the main thread completes.
>
> Looks like the hang occurs in some of the hook executed at the "exit" step. DId you check which ShutdownHook is executed and hang? Is it possible it is some of the AWT toolkit related?
> 
> 	at java.lang.Object.wait(java.base at 11.0.14-ea/Native Method)
> 	- waiting on <0x00000000ff504d78> (a java.lang.Thread)
> 	at java.lang.Thread.join(java.base at 11.0.14-ea/Thread.java:1305)
> 	- waiting to re-lock in wait() <0x00000000ff504d78> (a java.lang.Thread)
> 	at java.lang.Thread.join(java.base at 11.0.14-ea/Thread.java:1379)
> 	at java.lang.ApplicationShutdownHooks.runHooks(java.base at 11.0.14-ea/ApplicationShutdownHooks.java:107)
> 	at java.lang.ApplicationShutdownHooks$1.run(java.base at 11.0.14-ea/ApplicationShutdownHooks.java:46)

@mrserb I can see three non-daemon threads in 'WAITING' state(given below). So looks like 'AWT-Shutdown' thread created by AWTAutoShutdown.java is the hook which is getting blocked. But I think this is an expected behaviour only as it will block this thread until all AWT tasks are complete. 
"main" #1 prio=5 os_prio=0 cpu=78.13ms elapsed=240.13s tid=0x0000017129532000 nid=0x1518 in Object.wait()  [0x0000001fb8ffe000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(java.base at 11.0.14-ea/Native Method)
	- waiting on <0x00000000ff504d78> (a java.lang.Thread)
	at java.lang.Thread.join(java.base at 11.0.14-ea/Thread.java:1305)
	- waiting to re-lock in wait() <0x00000000ff504d78> (a java.lang.Thread)
	at java.lang.Thread.join(java.base at 11.0.14-ea/Thread.java:1379)
	at java.lang.ApplicationShutdownHooks.runHooks(java.base at 11.0.14-ea/ApplicationShutdownHooks.java:107)
	at java.lang.ApplicationShutdownHooks$1.run(java.base at 11.0.14-ea/ApplicationShutdownHooks.java:46)
	at java.lang.Shutdown.runHooks(java.base at 11.0.14-ea/Shutdown.java:130)
	at java.lang.Shutdown.exit(java.base at 11.0.14-ea/Shutdown.java:174)
	- locked <0x00000000ff50a4e0> (a java.lang.Class for java.lang.Shutdown)
	at java.lang.Runtime.exit(java.base at 11.0.14-ea/Runtime.java:113)
	at java.lang.System.exit(java.base at 11.0.14-ea/System.java:1750)
	at com.sun.javatest.regtest.agent.AStatus.exit(AStatus.java:199)
	at com.sun.javatest.regtest.agent.MainWrapper.main(MainWrapper.java:84)


"AWT-Shutdown" #24 prio=5 os_prio=0 cpu=0.00ms elapsed=239.97s tid=0x000001714cd43800 nid=0x29c4 in Object.wait()  [0x0000001fba6fe000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(java.base at 11.0.14-ea/Native Method)
	- waiting on <0x00000000ff69b6c0> (a java.lang.Object)
	at java.lang.Object.wait(java.base at 11.0.14-ea/Object.java:328)
	at sun.awt.AWTAutoShutdown.run(java.desktop at 11.0.14-ea/AWTAutoShutdown.java:291)
	- waiting to re-lock in wait() <0x00000000ff69b6c0> (a java.lang.Object)
	at java.lang.Thread.run(java.base at 11.0.14-ea/Thread.java:834)



"AWT-EventQueue-0" #27 prio=6 os_prio=0 cpu=109.38ms elapsed=239.96s tid=0x000001714d006800 nid=0x1f70 waiting on condition  [0x0000001fba8fe000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base at 11.0.14-ea/Native Method)
	- parking to wait for  <0x00000000ff6eda50> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(java.base at 11.0.14-ea/LockSupport.java:194)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base at 11.0.14-ea/AbstractQueuedSynchronizer.java:2081)
	at java.awt.EventQueue.getNextEvent(java.desktop at 11.0.14-ea/EventQueue.java:566)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(java.desktop at 11.0.14-ea/EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEventsForFilter(java.desktop at 11.0.14-ea/EventDispatchThread.java:124)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(java.desktop at 11.0.14-ea/EventDispatchThread.java:113)
	at java.awt.EventDispatchThread.pumpEvents(java.desktop at 11.0.14-ea/EventDispatchThread.java:109)
	at java.awt.EventDispatchThread.pumpEvents(java.desktop at 11.0.14-ea/EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.run(java.desktop at 11.0.14-ea/EventDispatchThread.java:90)

-------------

PR: https://git.openjdk.java.net/jdk/pull/5777



More information about the client-libs-dev mailing list