You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2010/08/12 21:56:17 UTC

[jira] Updated: (LUCENE-2598) allow tests to use different Directory impls

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

Robert Muir updated LUCENE-2598:
--------------------------------

    Attachment: LUCENE-2598.patch

Here's the first step, that adds newDirectory() and LuceneTestCase[J4] track if these are closed correctly by the tests.

i fixed places where it wasn't, but since we use MockRAMDirectory everywhere, it tracks if files are left open against it, and so I fixed all the unclosed Readers etc too in the tests.

There was only one non-test bug, PersistentSnapshotDeletionPolicy makes its own IndexWriter but if it throws an exception in the ctor, never closes it. 

> allow tests to use different Directory impls
> --------------------------------------------
>
>                 Key: LUCENE-2598
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2598
>             Project: Lucene - Java
>          Issue Type: Test
>          Components: Build
>    Affects Versions: 3.1, 4.0
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2598.patch
>
>
> Now that all tests use MockRAMDirectory instead of RAMDirectory, they are all picky like windows and force our tests to
> close readers etc before closing the directory.
> I think we should do the following:
> # change new MockRAMDIrectory() in tests to .newDirectory(random)
> # LuceneTestCase[J4] tracks if all dirs are closed at tearDown and also cleans up temp dirs like solr.
> # factor out the Mockish stuff from MockRAMDirectory into MockDirectoryWrapper
> # allow a -Dtests.directoryImpl or simpler to specify the default Directory to use for tests: default being "random"
> i think theres a chance we might find some bugs that havent yet surfaced because they are easier to trigger with FSDir
> Furthermore, this would be beneficial to Directory-implementors as they could run the entire testsuite against their Directory impl, just like codec-implementors can do now.

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


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