An addendum: this deadlock behavior does not seem to appear if the property 
-Dwt.headless is set.

________________________________
From: [email protected] [mailto:[email protected]] On 
Behalf Of Matt Brown
Sent: Tuesday, September 15, 2009 1:02 PM
To: [email protected]
Subject: [Webtest] Running groovy webtests from Maven seems to hang at 
wt.htmlReports

I have a Maven project which features a handful of Groovy WebtestCases that I 
wrote (each extends com.canoo.webtest.WebtestCase). I am running these tests 
during the integration-test phase (I've bound an execution of failsafe test 
runner to the integration-test phase, and the groovy classes are compiled with 
the gmaven-plugin).

After the tests (which fail, btw) are run, the wt.htmlReports step seems to 
hang forever (this is on a Windows XP machine):

Tests in error:
  testLoginSuccess(com.blah.LoginTest)
  testHomePage(com.blah.HomePageTest)

Tests run: 2, Failures: 0, Errors: 2, Skipped: 0


wt.htmlReports:
    [mkdir] Created dir: C:\Documents and 
Settings\...\target\test-classes\webtest-results\resources
     [copy] Copying 20 files to C:\Documents and 
Settings\...\target\test-classes\webtest-results\resources
     [xslt] Transforming into C:\Documents and 
Settings\...\target\test-classes\webtest-results
     [xslt] Transforming into C:\Documents and 
Settings\...\target\test-classes\webtest-results

("..." is not the real path)

Taking a look at the process in Process Explorer, the process seems to keep a 
file handle open to target\test-classes\webtest-resources\tools\spinner.gif. If 
I kill the Maven process, then any subsequent attempts to clean the project 
result in an error that this file is still locked.

Looking at the process in Visual VM, I see a thread related to 
groovy/WebTestMonitorImpl which seems to be dead-locked waiting for a 
java.awt.EventQueue$1AWTInvocationLock:

"Thread-3" prio=6 tid=0x034fd400 nid=0x1604 in Object.wait() 
[0x0409d000..0x0409fc94]
   java.lang.Thread.State: WAITING (on object monitor)
 at java.lang.Object.wait(Native Method)
 - waiting on <0x239b7518> (a java.awt.EventQueue$1AWTInvocationLock)
 at java.lang.Object.wait(Object.java:485)
 at java.awt.EventQueue.invokeAndWait(EventQueue.java:992)
 - locked <0x239b7518> (a java.awt.EventQueue$1AWTInvocationLock)
 at java.awt.Window.doDispose(Window.java:1029)
 at java.awt.Window.dispose(Window.java:972)
 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 
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)
 at 
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
 at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
 at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
 at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)
 at WebTestMonitorImpl.shutdown(WebTestMonitor.groovy:143)
 at WebTestMonitorImpl$shutdown.call(Unknown Source)
 at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
 ...

I've attached the complete thread dump.

Is it possible there is some sort of deadlock going on while copying the 
resources to the target directory? Has anyone seen this before?

Relevant version info:
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.6.0_13
Java home: C:\Program Files\Java\jdk1.6.0_13\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

com.canoo.webtest:webtest:3.1-SNAPSHOT

Thanks,
Matt Brown

Reply via email to