You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by Johan Lindquist <jo...@kawoo.co.uk> on 2004/08/20 09:45:20 UTC

Failling test for HIVEMIND-44 issue

Howard,

Tried to add a comment to the JIRA about HIVEMIND-44 but it was hopelessly  
down this morning, so i'll mail it here instead ...

I pulled the latest code out of CVS and the test  
"TestServiceModelThreading" consistently fails with something like:

[junit] Number of executions of the RunnableFixture expected:<200> but  
was:<198>

While looking at what the test does, I saw that you have put a comment on  
the run method of the RunnableFixture class saying that you don't have to  
synchronize the increment.  I think you would have to synchronize it as  
the increment operation involves both a read AND a write, making it  
non-atomic.

Anyway, to cut it short, adding a synchronized block around the increment  
operation fixes the test ...

Of course, I may be fixing the test rather than the problem, in which case  
it may need some more investigation ...

Johan

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: Failling test for HIVEMIND-44 issue

Posted by Howard Lewis Ship <hl...@gmail.com>.
My misunderstanding ... I've always thought that pre- and
post-increment operations were atomic. Must be a difference in VMs or
OSes that makes it fail consistently (I run these tests dozens of
times a day). I'll add in the synchronized keyword and we'll see.

On Fri, 20 Aug 2004 09:55:12 +0200, Johan Lindquist <jo...@kawoo.co.uk> wrote:
> Guess it was working after all - just extremely slowly :)
> 
> Johan
> 
> On Fri, 20 Aug 2004 09:45:20 +0200, Johan Lindquist <jo...@kawoo.co.uk>
> wrote:
> 
> 
> 
> > Howard,
> >
> > Tried to add a comment to the JIRA about HIVEMIND-44 but it was
> > hopelessly down this morning, so i'll mail it here instead ...
> >
> > I pulled the latest code out of CVS and the test
> > "TestServiceModelThreading" consistently fails with something like:
> >
> > [junit] Number of executions of the RunnableFixture expected:<200> but
> > was:<198>
> >
> > While looking at what the test does, I saw that you have put a comment
> > on the run method of the RunnableFixture class saying that you don't
> > have to synchronize the increment.  I think you would have to
> > synchronize it as the increment operation involves both a read AND a
> > write, making it non-atomic.
> >
> > Anyway, to cut it short, adding a synchronized block around the
> > increment operation fixes the test ...
> >
> > Of course, I may be fixing the test rather than the problem, in which
> > case it may need some more investigation ...
> >
> > Johan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: Failling test for HIVEMIND-44 issue

Posted by Johan Lindquist <jo...@kawoo.co.uk>.
Guess it was working after all - just extremely slowly :)

Johan

On Fri, 20 Aug 2004 09:45:20 +0200, Johan Lindquist <jo...@kawoo.co.uk>  
wrote:

> Howard,
>
> Tried to add a comment to the JIRA about HIVEMIND-44 but it was  
> hopelessly down this morning, so i'll mail it here instead ...
>
> I pulled the latest code out of CVS and the test  
> "TestServiceModelThreading" consistently fails with something like:
>
> [junit] Number of executions of the RunnableFixture expected:<200> but  
> was:<198>
>
> While looking at what the test does, I saw that you have put a comment  
> on the run method of the RunnableFixture class saying that you don't  
> have to synchronize the increment.  I think you would have to  
> synchronize it as the increment operation involves both a read AND a  
> write, making it non-atomic.
>
> Anyway, to cut it short, adding a synchronized block around the  
> increment operation fixes the test ...
>
> Of course, I may be fixing the test rather than the problem, in which  
> case it may need some more investigation ...
>
> Johan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org