You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Dan Murphy <dm...@googlemail.com> on 2007/02/15 14:17:54 UTC

[SCA Java] Failure in MemoryStoreTestCase (org.apache.tuscany.core.services.store.memory) during build

Hi,

Was trying to build, but the build kept failing :(

On my linux box I consistently see a failure in testEviction() when use a
command line mvn:
testEviction(
org.apache.tuscany.core.services.store.memory.MemoryStoreTestCase)  Time
elapsed: 0.304 sec  <<< FAILURE!
junit.framework.AssertionFailedError
        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.assertTrue(Assert.java:20)
        at junit.framework.Assert.assertNull(Assert.java:233)
        at junit.framework.Assert.assertNull(Assert.java:226)
        at
org.apache.tuscany.core.services.store.memory.MemoryStoreTestCase.testEviction
(MemoryStoreTestCase.java:52)

However, the test case does not fail in eclipse (although it seems to take
over a second in eclipse, so this is probaby why).

If I change the Thread.sleep to 500 ms then it passes on the command line.

There doesn't seem to be a code bug here (at least my reading of Reaper
inner class doesn't show any logic problems). There is quite a bit of
discussion on various web sites about accuracy of System.currentTimeMillis().
Given the values of reaperInterval = 300000 and defaultExpirationOffset =
600000 in MemoryStore it would seem like a good idea to just extend the
Thread.sleep in the test case to 500 ms....

Need a jira ?

Only reason I bring this up is I really don't want to run mvn -fn all the
time and have to then maually check the logs, but otherwise mvn always fails

Regards,
Dan

Re: [SCA Java] Failure in MemoryStoreTestCase (org.apache.tuscany.core.services.store.memory) during build

Posted by Jim Marino <jm...@myromatours.com>.
On Feb 15, 2007, at 5:27 AM, Dan Murphy wrote:

> Had another thought that might be related... my linux is using in
> pre-emptive multithreading mode:
> uname -a
> Linux dogpad 2.6.15-27-686 #1 SMP PREEMPT Fri Dec 8 18:00:07 UTC  
> 2006 i686
> GNU/Linux
> Which might help explain this timing/threaded issue.

It appears to be a timing issue. Instead of Thread.sleep() we should  
be using a Latch or something non-time dependent. This would be a  
good candidate for a patch if you are interested :-) Otherwise, I  
could get to it after some of the work I currently have in progress,  
which will be in a day or two.

Jim

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


Re: [SCA Java] Failure in MemoryStoreTestCase (org.apache.tuscany.core.services.store.memory) during build

Posted by Dan Murphy <dm...@googlemail.com>.
Had another thought that might be related... my linux is using in
pre-emptive multithreading mode:
uname -a
Linux dogpad 2.6.15-27-686 #1 SMP PREEMPT Fri Dec 8 18:00:07 UTC 2006 i686
GNU/Linux
Which might help explain this timing/threaded issue.


On 15/02/07, Dan Murphy <dm...@googlemail.com> wrote:
>
> Hi,
>
> Was trying to build, but the build kept failing :(
>
> On my linux box I consistently see a failure in testEviction() when use a
> command line mvn:
> testEviction(
> org.apache.tuscany.core.services.store.memory.MemoryStoreTestCase )  Time
> elapsed: 0.304 sec  <<< FAILURE!
> junit.framework.AssertionFailedError
>         at junit.framework.Assert.fail(Assert.java:47)
>         at junit.framework.Assert.assertTrue(Assert.java:20)
>         at junit.framework.Assert.assertNull(Assert.java:233)
>         at junit.framework.Assert.assertNull(Assert.java:226)
>         at
> org.apache.tuscany.core.services.store.memory.MemoryStoreTestCase.testEviction
> (MemoryStoreTestCase.java :52)
>
> However, the test case does not fail in eclipse (although it seems to take
> over a second in eclipse, so this is probaby why).
>
> If I change the Thread.sleep to 500 ms then it passes on the command line.
>
> There doesn't seem to be a code bug here (at least my reading of Reaper
> inner class doesn't show any logic problems). There is quite a bit of
> discussion on various web sites about accuracy of System.currentTimeMillis(). Given the values of reaperInterval = 300000 and defaultExpirationOffset
> = 600000 in MemoryStore it would seem like a good idea to just extend the
> Thread.sleep in the test case to 500 ms....
>
> Need a jira ?
>
> Only reason I bring this up is I really don't want to run mvn -fn all the
> time and have to then maually check the logs, but otherwise mvn always fails
>
> Regards,
> Dan
>