You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2003/02/17 10:22:42 UTC

ParallelTest fails randomly

Hi,

I'm getting this here

    [junit] Testcase: testTreadCount(org.apache.tools.ant.taskdefs.ParallelTest):	FAILED
    [junit] parallel tasks did't block on threads properly expected:<...2+1-1+3-2-3+2+1+3-1-2-3+2+1...> but was:<...1+2-1+3-2-3+1+2+3-1-2-3+1+2...>
    [junit] junit.framework.ComparisonFailure: parallel tasks did't block on threads properly expected:<...2+1-1+3-2-3+2+1+3-1-2-3+2+1...> but was:<...1+2-1+3-2-3+1+2+3-1-2-3+1+2...>

from time to time.

I will look into it myself, but maybe somebody else knows what is
going on (Conor?).

Stefan

Re: ParallelTest fails randomly

Posted by Danno Ferrin <sh...@yahoo.com>.
For the doco update there are some some issues pending... hopefully 
resoleved by tomorrow.

However, I was thinking of re-writign the test with a custom tast that 
would use a custom task to incrament/decrament a static counter, and I 
would just asser that the max value was less than or equal to the thread 
count.  That's really the behavior the test needs to assert, and we can 
reduce the amount of time it takes to run the tegt with that setup. 
 This is consistent with the behavior that start order can be 
guaranteed, but execution and finish order are up in the air, classic 
race condition stuff.

--Danno

Conor MacNeill wrote:

> Danno Ferrin wrote:
>
>> That looks like code I submitted, could you tell me OS and JDK 
>> versions you are running for this failure?  I may need to re-do the 
>> unit test to be tolerant of nideterminate behavior :(
>>
>
> I have added some delays to ensure tasks start in the order specified. 
> When you start three threads, the third may end up running before the 
> second. the old code would fail sometimes for me (Linux RH8.0, JDK 
> 1.4.1_01)
>
> BTW, any doco update?
>
> Conor
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>



Re: ParallelTest fails randomly

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Danno Ferrin wrote:
> That looks like code I submitted, could you tell me OS and JDK versions 
> you are running for this failure?  I may need to re-do the unit test to 
> be tolerant of nideterminate behavior :(
> 

I have added some delays to ensure tasks start in the order specified. When 
you start three threads, the third may end up running before the second. the 
old code would fail sometimes for me (Linux RH8.0, JDK 1.4.1_01)

BTW, any doco update?

Conor




Re: ParallelTest fails randomly

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 17 Feb 2003, Danno Ferrin <sh...@yahoo.com> wrote:

> That looks like code I submitted, could you tell me OS and JDK
> versions you are running for this failure?

Linux, Sun JDK 1.3.1_06.  It seems (seemed) to depend on the current
load.

> I may need to re-do the unit test to be tolerant of nideterminate
> behavior :(

I think Conor has already thrown in a couple of <sleep> tasks and
things are looking fine now.

Stefan

Re: ParallelTest fails randomly

Posted by Danno Ferrin <sh...@yahoo.com>.
That looks like code I submitted, could you tell me OS and JDK versions 
you are running for this failure?  I may need to re-do the unit test to 
be tolerant of nideterminate behavior :(

thanks
--Danno

Stefan Bodewig wrote:

>Hi,
>
>I'm getting this here
>
>    [junit] Testcase: testTreadCount(org.apache.tools.ant.taskdefs.ParallelTest):	FAILED
>    [junit] parallel tasks did't block on threads properly expected:<...2+1-1+3-2-3+2+1+3-1-2-3+2+1...> but was:<...1+2-1+3-2-3+1+2+3-1-2-3+1+2...>
>    [junit] junit.framework.ComparisonFailure: parallel tasks did't block on threads properly expected:<...2+1-1+3-2-3+2+1+3-1-2-3+2+1...> but was:<...1+2-1+3-2-3+1+2+3-1-2-3+1+2...>
>
>from time to time.
>
>I will look into it myself, but maybe somebody else knows what is
>going on (Conor?).
>
>Stefan
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>  
>



Re: ParallelTest fails randomly

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Stefan Bodewig wrote:
> Hi,
> 
> I will look into it myself, but maybe somebody else knows what is
> going on (Conor?).
> 

I'll look into it. I'll be doing some development on <parallel> soon.

Thanks
Conor