Wow, this is an incredible amount of work Sean. Amazing.
I took the new tests for a spin:
I ran into a problems with the first test executed, NormalTest in
math, hanging on ubuntu 10.04 because /dev/random doesn't contain
enough entropy. The test blocks for a very very long time trying to
read from from /dev/random. On my local machine I let it go for
minutes before killing it. Moving /dev/random and setting up a link to
/dev/urandom (the non blocking rng) from /dev/random worked. I suspect
this is an ubuntu specific problem, I've run into the issue before but
not to this degree.
java.lang.Thread.State: RUNNABLE
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:199)
at
org.uncommons.maths.random.DevRandomSeedGenerator.generateSeed(DevRandomSeedGenerator.java:49)
at
org.uncommons.maths.random.DefaultSeedGenerator.generateSeed(DefaultSeedGenerator.java:71)
at
org.uncommons.maths.random.MersenneTwisterRNG.<init>(MersenneTwisterRNG.java:74)
at
org.apache.mahout.common.RandomWrapper.buildRandom(RandomWrapper.java:53)
at org.apache.mahout.common.RandomWrapper.<init>(RandomWrapper.java:37)
at org.apache.mahout.common.RandomUtils.getRandom(RandomUtils.java:55)
at
org.apache.mahout.math.jet.random.NormalTest.consistency(NormalTest.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
It appears that the hudson build gets stuck for a bit in the same place:
(from :https://hudson.apache.org/hudson/job/Mahout-Quality/237/console)
Running org.apache.mahout.math.jet.random.NormalTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 165.554 sec
I'm also running into issues with o.a.m.df.data.DataTest and
o.a.m.cf.taste.hadoop.similarity.item.ItemSimilarityTest. Looks like
DataTest needs @Test annotations and ItemSimilarityTest has a @Test
annotation on a method that isn't a unit test. I've fixed these and
can commit if you're ok with that.
Other that that everything works beautifully here.
Drew
On Fri, Sep 3, 2010 at 8:38 AM, Sean Owen <[email protected]> wrote:
> Committed. I reluctantly commented out NegativeBinomialTest.sample(),
> since it was the straggler I couldn't fix. I was able to get it to
> pass or fail reliably by just seeding the RNG differently, so I
> somehow suspect the test conditions are too strict, or else it needs
> to be simply re-tuned for the current RNG's behavior. Hope that's OK.
>
>
> I also saw a very odd problem. The superclass of all test cases lives
> in mahout-math, and defines a constant EPSILON to use for asserting
> floating-point equality within bounds (you have to use an epsilon now
> in JUnit 4). It all works fine. But for some reason when building with
> Maven, this symbol is not visible across modules. Methods, all else
> are.
>
> I had to artificially stick a sub-superclass within each module that
> redefines the constant. It works, isn't too messy, but isn't ideal. If
> anyone has any clue what's going on I'd love to hear it.
>
>
> All else should be OK, but, I wouldn't be shocked if some subtle issue
> pops up once this hits Hudson. Bear with me.
>
> So, the headline is: write JUnit 4 tests now.
>
> public final class MyTest extends MahoutTestCase {
> �...@test
> public void testFoo() {
> assertEquals(3.1415926535, Math.PI, EPSILON);
> }
> }
>
>
> On Fri, Sep 3, 2010 at 10:48 AM, Sean Owen <[email protected]> wrote:
>> I've finished, and boy it did take some work. All the tests are on
>> JUnit 4 and in the process have been standardized a bit (e.g. some
>> tests were still manually managing temp files).
>>
>> I am having some strange trouble with NegativeBinomialTest -- passes
>> in my IDE, not via Maven. I'd blame randomness but I have pretty
>> thoroughly hunted down those causes. And it consistently passes/fails
>> in these contexts.
>>
>> I am considering commenting out the one test that fails ("sample()")
>> with a TODO and then asking for other eyes to look at this?
>>
>> Because this is a good big change I'd like to get in. It standardizes
>> the tests a lot more.
>