[infinispan-dev] Hanging testsuite / bug in TestNG?

Adrian Nistor anistor at redhat.com
Tue Jun 26 16:21:37 EDT 2012


Hi Sanne,

I know the explanation was a bit laconic so I'll try to expand it a bit.
surefire has a buffer (a List actually) were console output is 
accumulated during each test.
The list is synchronized so multiple threads writing to console is not 
causing List corruption.
There is a very sensitive moment though at the end of the test when this 
List of text lines is consolidated into a StringBuffer that is added to 
the test report. Unfortunately during consolidation the List is accessed 
without proper synchronization and if some stray thread outlives the 
test and continues to generate output or we run multiple tests 
concurrently - this will most likely cause a 
ConcurrentModificationException.  Of course this problem is avoided if 
you disable logging to console :). Actually not entirely avoided, but  
minimized, because some tests also write to console directly using 
System.out.println() and that can still trigger the issue.

Adrian

On 06/26/2012 07:33 PM, Sanne Grinovero wrote:
> On 26 June 2012 16:55, Adrian Nistor <anistor at redhat.com> wrote:
>> It doesn't know or care about it. But by disabling log4j console appender
>> you minimize the amount of text written to console and the risk to trigger
>> the surefire-report bug.
> because it returns quicker?




More information about the infinispan-dev mailing list