You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2010/10/03 12:37:33 UTC

[jira] Resolved: (MAHOUT-515) PFPGrowthTest has a hard-wired reference to an existing output directory

     [ https://issues.apache.org/jira/browse/MAHOUT-515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Owen resolved MAHOUT-515.
------------------------------

      Assignee: Jeff Eastman
    Resolution: Fixed

Do I understand this is resolved then? Tests run locally and on Maven for me, and on Hudson AFAICT. If it's just a hygiene issues definitely go forth and tweak it.

> PFPGrowthTest has a hard-wired reference to an existing output directory
> ------------------------------------------------------------------------
>
>                 Key: MAHOUT-515
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-515
>             Project: Mahout
>          Issue Type: Bug
>          Components: Frequent Itemset/Association Rule Mining
>    Affects Versions: 0.3
>            Reporter: Jeff Eastman
>            Assignee: Jeff Eastman
>             Fix For: 0.4
>
>
> This test began failing when another test was added which had the same dependency. That test has been corrected but is not yet checked-in.
> The correct pattern is to use getTestTempDirPath() to allocate temporary files. I was unable to quickly do this in the test (it caused other of its tests to fail) so I'm opening an issue for somebody more knowledgeable in this code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Resolved: (MAHOUT-515) PFPGrowthTest has a hard-wired reference to an existing output directory

Posted by Robin Anil <ro...@gmail.com>.
On it

On Sun, Oct 3, 2010 at 7:38 PM, Jeff Eastman <jd...@windwardsolutions.com>wrote:

>  I've tried to incorporate getTestTempDirPath for the output directory but
> it causes 2 of the 3 tests to fail. I've tried debugging that for a couple
> of hours to no avail. As-is the test passes but is a waiting trap for the
> next test which may get written using the local output directory. Not a
> showstopper for 0.4 RC but I think it ought to be corrected.
>
> It should be a simple fix for someone who understands the code or who can
> look at it from a fresh perspective. The test is setting
>     params.set("output", "output/frequentpatterns");
> but then, in PFPGrowth it's doing things like
>    Path parallelCountingPath = new Path(params.get("output"),
> "parallelcounting");
> and, even
>    Path frequentPatternsPath = new Path(params.get("output"),
> "frequentPatterns");
>
> It's not fixed yet.
>
>
>
>
> On 10/3/10 6:37 AM, Sean Owen (JIRA) wrote:
>
>>      [
>> https://issues.apache.org/jira/browse/MAHOUT-515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>>
>> Sean Owen resolved MAHOUT-515.
>> ------------------------------
>>
>>       Assignee: Jeff Eastman
>>     Resolution: Fixed
>>
>> Do I understand this is resolved then? Tests run locally and on Maven for
>> me, and on Hudson AFAICT. If it's just a hygiene issues definitely go forth
>> and tweak it.
>>
>>  PFPGrowthTest has a hard-wired reference to an existing output directory
>>> ------------------------------------------------------------------------
>>>
>>>                 Key: MAHOUT-515
>>>                 URL: https://issues.apache.org/jira/browse/MAHOUT-515
>>>             Project: Mahout
>>>          Issue Type: Bug
>>>          Components: Frequent Itemset/Association Rule Mining
>>>    Affects Versions: 0.3
>>>            Reporter: Jeff Eastman
>>>            Assignee: Jeff Eastman
>>>             Fix For: 0.4
>>>
>>>
>>> This test began failing when another test was added which had the same
>>> dependency. That test has been corrected but is not yet checked-in.
>>> The correct pattern is to use getTestTempDirPath() to allocate temporary
>>> files. I was unable to quickly do this in the test (it caused other of its
>>> tests to fail) so I'm opening an issue for somebody more knowledgeable in
>>> this code.
>>>
>>
>

Re: [jira] Resolved: (MAHOUT-515) PFPGrowthTest has a hard-wired reference to an existing output directory

Posted by Robin Anil <ro...@gmail.com>.
Yeah chose the easy way ;) merged all into one giant test. Also cleaned up a
lot of String append happening in PFPGrowth to Path(parent,
child). Committing the changes.

Re: [jira] Resolved: (MAHOUT-515) PFPGrowthTest has a hard-wired reference to an existing output directory

Posted by Sean Owen <sr...@gmail.com>.
Well that works too if you must.

But the idea is BTW to not make our own temp files but use the handy
mechanisms in MahoutTestCase to get handles on temp files. It'll do all the
setting up and tearing down for you to make sure they don't linger.

On Mon, Oct 4, 2010 at 11:21 PM, Ted Dunning <te...@gmail.com> wrote:

> If you just want it preserved during the tests in a single class, use
> @BeforeClass to create it and @AfterClass to nuke it.
>
> The name of the directory can be gotten from the normal temp directory
> methods in File.
>
>

Re: [jira] Resolved: (MAHOUT-515) PFPGrowthTest has a hard-wired reference to an existing output directory

Posted by Ted Dunning <te...@gmail.com>.
If you just want it preserved during the tests in a single class, use
@BeforeClass to create it and @AfterClass to nuke it.

The name of the directory can be gotten from the normal temp directory
methods in File.

On Mon, Oct 4, 2010 at 3:17 PM, Robin Anil <ro...@gmail.com> wrote:

> The temp folder gets deleted after each test. Its not getting preserved
> across tests. Thats why things are failing. Can you tell me how I can keep
> the dir for the entire duration of the Test File Suite?
>
>
> On Sun, Oct 3, 2010 at 7:38 PM, Jeff Eastman <jdog@windwardsolutions.com
> >wrote:
>
> >  I've tried to incorporate getTestTempDirPath for the output directory
> but
> > it causes 2 of the 3 tests to fail. I've tried debugging that for a
> couple
> > of hours to no avail. As-is the test passes but is a waiting trap for the
> > next test which may get written using the local output directory. Not a
> > showstopper for 0.4 RC but I think it ought to be corrected.
> >
> > It should be a simple fix for someone who understands the code or who can
> > look at it from a fresh perspective. The test is setting
> >     params.set("output", "output/frequentpatterns");
> > but then, in PFPGrowth it's doing things like
> >    Path parallelCountingPath = new Path(params.get("output"),
> > "parallelcounting");
> > and, even
> >    Path frequentPatternsPath = new Path(params.get("output"),
> > "frequentPatterns");
> >
> > It's not fixed yet.
> >
> >
> >
> >
> > On 10/3/10 6:37 AM, Sean Owen (JIRA) wrote:
> >
> >>      [
> >>
> https://issues.apache.org/jira/browse/MAHOUT-515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
> >>
> >> Sean Owen resolved MAHOUT-515.
> >> ------------------------------
> >>
> >>       Assignee: Jeff Eastman
> >>     Resolution: Fixed
> >>
> >> Do I understand this is resolved then? Tests run locally and on Maven
> for
> >> me, and on Hudson AFAICT. If it's just a hygiene issues definitely go
> forth
> >> and tweak it.
> >>
> >>  PFPGrowthTest has a hard-wired reference to an existing output
> directory
> >>>
> ------------------------------------------------------------------------
> >>>
> >>>                 Key: MAHOUT-515
> >>>                 URL: https://issues.apache.org/jira/browse/MAHOUT-515
> >>>             Project: Mahout
> >>>          Issue Type: Bug
> >>>          Components: Frequent Itemset/Association Rule Mining
> >>>    Affects Versions: 0.3
> >>>            Reporter: Jeff Eastman
> >>>            Assignee: Jeff Eastman
> >>>             Fix For: 0.4
> >>>
> >>>
> >>> This test began failing when another test was added which had the same
> >>> dependency. That test has been corrected but is not yet checked-in.
> >>> The correct pattern is to use getTestTempDirPath() to allocate
> temporary
> >>> files. I was unable to quickly do this in the test (it caused other of
> its
> >>> tests to fail) so I'm opening an issue for somebody more knowledgeable
> in
> >>> this code.
> >>>
> >>
> >
>

Re: [jira] Resolved: (MAHOUT-515) PFPGrowthTest has a hard-wired reference to an existing output directory

Posted by Ted Dunning <te...@gmail.com>.
Junit 4 adds class level setup/teardown which is nice for this kind of
thing.  However, I
don't think that it is really needed.  Class level setup is really just to
decrease the cost
by amortizing an expensive setup over several tests.

IF the tests are assumed to execute in order, however, then it really should
just be one
big test and class level setup isn't required.

IF they aren't assumed to be in order, then why do they need to have their
temp files in the
same place?

Either answer leads to test level setup/teardown rather than class level
operations.

On Mon, Oct 4, 2010 at 3:20 PM, Sean Owen <sr...@gmail.com> wrote:

> The idea in JUnit is that each test method is independent of the others.
> All
> set up is done in setUp() (and undone in tearDown()) if needed. So the
> JUnit
> way to do this is to set it up in setUp(). And I think we should stick to
> the JUnit way since as you see it doesn't work otherwise :) Sounds like
> what
> you have is one big test method.
>
> On Mon, Oct 4, 2010 at 11:17 PM, Robin Anil <ro...@gmail.com> wrote:
>
> > The temp folder gets deleted after each test. Its not getting preserved
> > across tests. Thats why things are failing. Can you tell me how I can
> keep
> > the dir for the entire duration of the Test File Suite?
> >
> >
>

Re: [jira] Resolved: (MAHOUT-515) PFPGrowthTest has a hard-wired reference to an existing output directory

Posted by Sean Owen <sr...@gmail.com>.
The idea in JUnit is that each test method is independent of the others. All
set up is done in setUp() (and undone in tearDown()) if needed. So the JUnit
way to do this is to set it up in setUp(). And I think we should stick to
the JUnit way since as you see it doesn't work otherwise :) Sounds like what
you have is one big test method.

On Mon, Oct 4, 2010 at 11:17 PM, Robin Anil <ro...@gmail.com> wrote:

> The temp folder gets deleted after each test. Its not getting preserved
> across tests. Thats why things are failing. Can you tell me how I can keep
> the dir for the entire duration of the Test File Suite?
>
>

Re: [jira] Resolved: (MAHOUT-515) PFPGrowthTest has a hard-wired reference to an existing output directory

Posted by Robin Anil <ro...@gmail.com>.
The temp folder gets deleted after each test. Its not getting preserved
across tests. Thats why things are failing. Can you tell me how I can keep
the dir for the entire duration of the Test File Suite?


On Sun, Oct 3, 2010 at 7:38 PM, Jeff Eastman <jd...@windwardsolutions.com>wrote:

>  I've tried to incorporate getTestTempDirPath for the output directory but
> it causes 2 of the 3 tests to fail. I've tried debugging that for a couple
> of hours to no avail. As-is the test passes but is a waiting trap for the
> next test which may get written using the local output directory. Not a
> showstopper for 0.4 RC but I think it ought to be corrected.
>
> It should be a simple fix for someone who understands the code or who can
> look at it from a fresh perspective. The test is setting
>     params.set("output", "output/frequentpatterns");
> but then, in PFPGrowth it's doing things like
>    Path parallelCountingPath = new Path(params.get("output"),
> "parallelcounting");
> and, even
>    Path frequentPatternsPath = new Path(params.get("output"),
> "frequentPatterns");
>
> It's not fixed yet.
>
>
>
>
> On 10/3/10 6:37 AM, Sean Owen (JIRA) wrote:
>
>>      [
>> https://issues.apache.org/jira/browse/MAHOUT-515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>>
>> Sean Owen resolved MAHOUT-515.
>> ------------------------------
>>
>>       Assignee: Jeff Eastman
>>     Resolution: Fixed
>>
>> Do I understand this is resolved then? Tests run locally and on Maven for
>> me, and on Hudson AFAICT. If it's just a hygiene issues definitely go forth
>> and tweak it.
>>
>>  PFPGrowthTest has a hard-wired reference to an existing output directory
>>> ------------------------------------------------------------------------
>>>
>>>                 Key: MAHOUT-515
>>>                 URL: https://issues.apache.org/jira/browse/MAHOUT-515
>>>             Project: Mahout
>>>          Issue Type: Bug
>>>          Components: Frequent Itemset/Association Rule Mining
>>>    Affects Versions: 0.3
>>>            Reporter: Jeff Eastman
>>>            Assignee: Jeff Eastman
>>>             Fix For: 0.4
>>>
>>>
>>> This test began failing when another test was added which had the same
>>> dependency. That test has been corrected but is not yet checked-in.
>>> The correct pattern is to use getTestTempDirPath() to allocate temporary
>>> files. I was unable to quickly do this in the test (it caused other of its
>>> tests to fail) so I'm opening an issue for somebody more knowledgeable in
>>> this code.
>>>
>>
>

Re: [jira] Resolved: (MAHOUT-515) PFPGrowthTest has a hard-wired reference to an existing output directory

Posted by Jeff Eastman <jd...@windwardsolutions.com>.
  I've tried to incorporate getTestTempDirPath for the output directory 
but it causes 2 of the 3 tests to fail. I've tried debugging that for a 
couple of hours to no avail. As-is the test passes but is a waiting trap 
for the next test which may get written using the local output 
directory. Not a showstopper for 0.4 RC but I think it ought to be 
corrected.

It should be a simple fix for someone who understands the code or who 
can look at it from a fresh perspective. The test is setting
      params.set("output", "output/frequentpatterns");
but then, in PFPGrowth it's doing things like
     Path parallelCountingPath = new Path(params.get("output"), 
"parallelcounting");
and, even
     Path frequentPatternsPath = new Path(params.get("output"), 
"frequentPatterns");

It's not fixed yet.



On 10/3/10 6:37 AM, Sean Owen (JIRA) wrote:
>       [ https://issues.apache.org/jira/browse/MAHOUT-515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Sean Owen resolved MAHOUT-515.
> ------------------------------
>
>        Assignee: Jeff Eastman
>      Resolution: Fixed
>
> Do I understand this is resolved then? Tests run locally and on Maven for me, and on Hudson AFAICT. If it's just a hygiene issues definitely go forth and tweak it.
>
>> PFPGrowthTest has a hard-wired reference to an existing output directory
>> ------------------------------------------------------------------------
>>
>>                  Key: MAHOUT-515
>>                  URL: https://issues.apache.org/jira/browse/MAHOUT-515
>>              Project: Mahout
>>           Issue Type: Bug
>>           Components: Frequent Itemset/Association Rule Mining
>>     Affects Versions: 0.3
>>             Reporter: Jeff Eastman
>>             Assignee: Jeff Eastman
>>              Fix For: 0.4
>>
>>
>> This test began failing when another test was added which had the same dependency. That test has been corrected but is not yet checked-in.
>> The correct pattern is to use getTestTempDirPath() to allocate temporary files. I was unable to quickly do this in the test (it caused other of its tests to fail) so I'm opening an issue for somebody more knowledgeable in this code.