You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by Jeff Eastman <jd...@windwardsolutions.com> on 2010/01/18 01:26:26 UTC

Eclipse and Maven Don't Agree

I've made some changes for MAHOUT-251 and all the tests run in Eclipse, 
but two of them fail when run from Maven. How can I poke mvn to give me 
more diagnostics?

Re: Eclipse and Maven Don't Agree

Posted by Olivier Grisel <ol...@ensta.org>.
2010/1/18 Jeff Eastman <jd...@windwardsolutions.com>:
> Sean Owen wrote:
>>
>> Could be. I took an indirect stab at mitigating possible sources of
>> this issue by increasing encapsulation in the tests -- I still believe
>> fields should never by non-private. This may start to surface the
>> behind-the-scenes dependencies and side effects that shouldn't be
>> there. But the issue, if you're right, probably concerns too much
>> static stuff.
>>
>> What tests are failing?
>>
>>
>
> I tried -X, --error and --debug options but none gave me any more resolution
> on the problem. Thinking this might be an initialization issue, I commented
> out the two assertEquals statements in
> ../dirichlet/TestMapReduce.testMapper() and .testReducer() and now the Maven
> install runs just fine. So, it looks to me like a recent change to the way
> random numbers are initialized introduced the problem. I don't know why
> nobody else is seeing this, since I have not changed either of those two
> tests.

Have you tried to have a look at the surefire test reports in:

  mahout/core/target/surefire-reports

?

Failure stacktraces are stored in org.apache.mahout.*.txt files.

If you want to plug eclipse to the JVM running the maven surefire
tests to setup breakpoints:

  http://maven.apache.org/plugins/maven-surefire-plugin/examples/debugging.html

-- 
Olivier
http://twitter.com/ogrisel - http://code.oliviergrisel.name

Re: Eclipse and Maven Don't Agree

Posted by Jeff Eastman <jd...@windwardsolutions.com>.
Sean Owen wrote:
> Could be. I took an indirect stab at mitigating possible sources of
> this issue by increasing encapsulation in the tests -- I still believe
> fields should never by non-private. This may start to surface the
> behind-the-scenes dependencies and side effects that shouldn't be
> there. But the issue, if you're right, probably concerns too much
> static stuff.
>
> What tests are failing?
>
>   
I tried -X, --error and --debug options but none gave me any more 
resolution on the problem. Thinking this might be an initialization 
issue, I commented out the two assertEquals statements in 
../dirichlet/TestMapReduce.testMapper() and .testReducer() and now the 
Maven install runs just fine. So, it looks to me like a recent change to 
the way random numbers are initialized introduced the problem. I don't 
know why nobody else is seeing this, since I have not changed either of 
those two tests.

When run from Eclipse one test class at a time, the random number 
generator is initialized one way and the two tests pass. During the 
Maven run; however, it is initialized differently (or not at the start 
of the test) and so these two tests produce different numbers of mapper 
partitions (collector keys) and those two tests fail.

I'm going to check in the modified tests - with no asserts - while we 
sort out the random number seeding or I figure out a better way to do 
the tests. Testing Dirichlet is darn difficult because all of the 
random-induced moving parts.

Re: Eclipse and Maven Don't Agree

Posted by Sean Owen <sr...@gmail.com>.
Could be. I took an indirect stab at mitigating possible sources of
this issue by increasing encapsulation in the tests -- I still believe
fields should never by non-private. This may start to surface the
behind-the-scenes dependencies and side effects that shouldn't be
there. But the issue, if you're right, probably concerns too much
static stuff.

What tests are failing?

Re: Eclipse and Maven Don't Agree

Posted by Ted Dunning <te...@gmail.com>.
This sounds like it is related to running tests in a single JVM and thus
related to ordering of tests.

Ick.

On Sun, Jan 17, 2010 at 5:23 PM, Benson Margulies <bi...@gmail.com>wrote:

> -X?
>
> Use the surefire options to allow you to attach eclipse to the test
> once launched from maven? That's foolproof.
>
> On Sun, Jan 17, 2010 at 7:26 PM, Jeff Eastman
> <jd...@windwardsolutions.com> wrote:
> > I've made some changes for MAHOUT-251 and all the tests run in Eclipse,
> but
> > two of them fail when run from Maven. How can I poke mvn to give me more
> > diagnostics?
> >
>



-- 
Ted Dunning, CTO
DeepDyve

Re: Eclipse and Maven Don't Agree

Posted by Benson Margulies <bi...@gmail.com>.
-X?

Use the surefire options to allow you to attach eclipse to the test
once launched from maven? That's foolproof.

On Sun, Jan 17, 2010 at 7:26 PM, Jeff Eastman
<jd...@windwardsolutions.com> wrote:
> I've made some changes for MAHOUT-251 and all the tests run in Eclipse, but
> two of them fail when run from Maven. How can I poke mvn to give me more
> diagnostics?
>