Check this out: (FYI this is my test; doesn't exist upstream yet):
> ant test -Dtestcase=HeatmapSpatialFieldTest
BUILD SUCCESSFUL, 1 minute 40 seconds
> ant test-core -Dtestcase=HeatmapSpatialFieldTest
BUILD FAILED, 25 seconds
<target name="test" description="Validate, then run core, solrj, and
contrib unit tests."
depends="-init-totals, test-core, test-contrib, -check-totals"/>
<target name="test-core" description="Runs the core and solrj unit tests."
depends="-clover.load, test-solr-core, test-solrj"/>
So it turns out the "-init-totals" task sets up the temp dir along with a
deleteonexit.
Just to verify, I temporarily modified test-core to first invoke
"-init-totals", and it passed! Perhaps all the test-* tasks should
simply have an "-init-totals" and "-check-totals" then?
~ David
On Tue, Jan 24, 2017 at 6:06 AM Dawid Weiss <[email protected]> wrote:
> It's exactly that, actually. We place java.io.tmpdir under ./, so this
> directory always remains after the tests are done. I filed this issue:
>
> https://github.com/randomizedtesting/randomizedtesting/issues/247
>
> But I honestly don't know what the "right" way to fix it is. The
> runner assumes cwd should be left clean -- perhaps this should be a
> switch too (with similar wipe|ignore|warn options, defaulting to warn
> for backcompat).
>
> Note that LuceneTestCase already has leftover file detection facility
> it manages internally anyway (TestRuleTemporaryFilesCleanup).
>
> Dawid
>
> On Mon, Jan 23, 2017 at 7:22 PM, Dawid Weiss <[email protected]>
> wrote:
> > No problem at all. I wonder if we (in Lucene) don't point the temp
> > folder under cwd -- we probably do... If so then this is something I
> > didn't give much thought to... special case which should probably be
> > allowed. Check common-build and confirm if this is the case.
> >
> > Dawid
> >
> > On Mon, Jan 23, 2017 at 3:41 PM, David Smiley <[email protected]>
> wrote:
> >> Thanks very much Dawid. So indeed, the directory in question isn't
> quite
> >> empty; it contains a "temp" directory (that is empty). Off to the next
> >> thing to debug....
> >>
> >> Thanks again.
> >> ~ David
> >>
> >> On Mon, Jan 23, 2017 at 7:40 AM Dawid Weiss <[email protected]>
> wrote:
> >>>
> >>> I've committed LUCENE-7653 which should help you diagnose the problem,
> >>> David. First, it'll clean the cwd of a forked process before the tests
> >>> start (something that wasn't done before). Second, it'll report what
> >>> files remained uncleaned after a run.
> >>>
> >>> Hope it'll help.
> >>>
> >>> Dawid
> >>>
> >>> On Fri, Jan 20, 2017 at 8:57 AM, Dawid Weiss <[email protected]>
> >>> wrote:
> >>> > Hi David!
> >>> >
> >>> >> I can't find the string "Could not remove temporary path" in our
> >>> >> codebase;
> >>> >> maybe it's in randomized-testing? (CC Dawid) I'm not sure how to
> >>> >> debug
> >>> >> this... maybe Solr wasn't closed properly? Although this doesn't
> >>> >> happen
> >>> >
> >>> > Yes, this message has a source in ANT's unit test runner code, here:
> >>> >
> >>> >
> >>> >
> https://github.com/randomizedtesting/randomizedtesting/blob/master/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L1031-L1041
> >>> >
> >>> > Specifically, it couldn't delete the temporary folder -- most likely
> >>> > it wasn't empty (there were some files inside the folder). I think
> the
> >>> > message here should be improved -- I'll do that -- but in the mean
> >>> > time make sure the test's folder is empty; if it isn't, the build
> will
> >>> > fail.
> >>> >
> >>> > Dawid
> >>
> >> --
> >> Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
> >> LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
> >> http://www.solrenterprisesearchserver.com
>
--
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com