<div class="gmail_quote">On Mon, Jun 25, 2012 at 10:48 PM, Sanne Grinovero <span dir="ltr">&lt;<a href="mailto:sanne@infinispan.org" target="_blank">sanne@infinispan.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>On 25 June 2012 20:06, Dan Berindei &lt;<a href="mailto:dan.berindei@gmail.com" target="_blank">dan.berindei@gmail.com</a>&gt; wrote:<br>
&gt; On Mon, Jun 25, 2012 at 5:58 PM, Sanne Grinovero &lt;<a href="mailto:sanne@infinispan.org" target="_blank">sanne@infinispan.org</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi all,<br>
&gt;&gt; the testsuite on master is regularly hanging for me, and I get all<br>
&gt;&gt; threads waiting while this one is spinning on the put() operation.<br>
&gt;&gt;<br>
&gt;&gt; java.lang.Thread.State: RUNNABLE<br>
&gt;&gt;        at java.util.HashMap.put(HashMap.java:374)<br>
&gt;&gt;        at org.testng.SuiteRunner.runTest(SuiteRunner.java:320)<br>
&gt;&gt;        at org.testng.SuiteRunner.access$000(SuiteRunner.java:34)<br>
&gt;&gt;        at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:351)<br>
&gt;&gt;        at<br>
&gt;&gt; org.testng.internal.thread.ThreadUtil$CountDownLatchedRunnable.run(ThreadUtil.java:147)<br>
&gt;&gt;        at<br>
&gt;&gt; java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)<br>
&gt;&gt;        at<br>
&gt;&gt; java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)<br>
&gt;&gt;        at java.lang.Thread.run(Thread.java:662)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Clearly the parallel testsuite is not synchronizing properly on the<br>
&gt;&gt; HashMap, this looks like a TestNG bug.<br>
&gt;&gt;<br>
&gt;&gt; So I&#39;ve tried to update to latest 6.5.2; from the Changelog this looks<br>
&gt;&gt; like fixed, as is a very long list of other issues; not least<br>
&gt;&gt;<br>
&gt;&gt; &quot;Fixed: Skipped tests were not always counted&quot;<br>
&gt;&gt;<br>
&gt;&gt; which might address the strange numbers we had noticed on Jenkins.<br>
&gt;&gt;<br>
&gt;<br>
&gt; Excellent!<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; But I&#39;m still unable to run the full testsuite; what follows are the<br>
&gt;&gt; reasons from several different attempts:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; testng-SyncBasicSingleLockOptimisticTest) Exiting because<br>
&gt;&gt; lock.singlelock.SyncBasicSingleLockOptimisticTest has NOT shut down<br>
&gt;&gt; all the cache managers it has started !!!!!!!<br>
&gt;&gt;<br>
&gt;&gt; testng-SyncBasicSingleLockOptimisticTest) Exiting because<br>
&gt;&gt; lock.singlelock.SyncBasicSingleLockOptimisticTest has NOT shut down<br>
&gt;&gt; all the cache managers it has started !!!!!<br>
&gt;&gt;<br>
&gt;&gt; (testng-BasicSingleLockOptimisticTest) Exiting because<br>
&gt;&gt; lock.singlelock.BasicSingleLockOptimisticTest has NOT shut down all<br>
&gt;&gt; the cache managers it has started !!!!!!!<br>
&gt;&gt;<br>
&gt;&gt; (testng-BasicSingleLockOptimisticTest) Exiting because<br>
&gt;&gt; lock.singlelock.BasicSingleLockOptimisticTest has NOT shut down all<br>
&gt;&gt; the cache managers it has started !!!!!!!<br>
&gt;&gt;<br>
&gt;&gt; (testng-SyncBasicSingleLockOptimisticTest) Exiting because<br>
&gt;&gt; lock.singlelock.SyncBasicSingleLockOptimisticTest has NOT shut down<br>
&gt;&gt; all the cache managers it has started !!!!!!!<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Looking into the BasicSingleLockOptimisticTest I&#39;m not seeing how this<br>
&gt;&gt; could be possible, so I&#39;m wondering if this could be a problem related<br>
&gt;&gt; to the TestNG update? Any thoughts?<br>
&gt;&gt;<br>
&gt;<br>
&gt; Galder and I saw the same thing with another test in Jenkins:<br>
&gt; <a href="https://issues.jboss.org/browse/ISPN-2117?focusedCommentId=12702926&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12702926" target="_blank">https://issues.jboss.org/browse/ISPN-2117?focusedCommentId=12702926&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12702926</a><br>


&gt;<br>
&gt; To reiterate here, there was/is another concurrency issue in the<br>
&gt; maven-surefire-plugin that caused it to sometimes skip @AfterMethod methods<br>
&gt; after a failure. Galder upgraded the plugin to 2.12 hoping it would fix the<br>
&gt; problem, but if you&#39;re still seeing I guess that wasn&#39;t enough...<br>
<br>
</div></div>Thanks Dan! Strange that this happens to me consistently on the same<br>
test.. do you know what is supposed to trigger this @AfterMethod<br>
failure? Is there a reference to the Surefire issue?<br>
<br></blockquote></div><br>I&#39;m not sure why you can reproduce it so reliably, but it&#39;s probably related to the fact that this test always fails for you (and it doesn&#39;t fail for us).<br><br>I didn&#39;t find any related issue in the surefire JIRA, if you can still reproduce it with maven-surefire-report-plugin 2.12 I&#39;d say create a new issue yourself and paste the ConcurrentModificationException stack trace from your logs (or give it to me and I&#39;ll create the issue).<br>

<br>I had a quick look at the 2.12 source code and it seems like the problem is still there: TestSetRunListener.writeTestOutput can still modify the list of lines in testStdOut after a failure (because our caches keep on running and logging stuff), and in parallel TestSetRunListener.testFailed will call TestSetRunListener.getAsString, which will iterate over testStdOut. Since there is no synchronization in either writeTestOutput or in getAsString, it&#39;s possible to get a ConcurrentModificationException there.<br>

<br><br>Cheers<br>Dan<br><br>