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

Robert Muir resolved LUCENE-3899.
---------------------------------

    Resolution: Fixed
    
> Evil up MockDirectoryWrapper.checkIndexOnClose
> ----------------------------------------------
>
>                 Key: LUCENE-3899
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3899
>             Project: Lucene - Java
>          Issue Type: Test
>            Reporter: Robert Muir
>             Fix For: 3.6, 4.0
>
>         Attachments: LUCENE-3899.patch
>
>
> MockDirectoryWrapper checks any indexes tests create on close(), if they 
> exist.
> The problem is the logic it uses to determine if an index exists could mask 
> real bugs (e.g. segments file corrumption):
> {code}
> if (DirectoryReader.indexExists(this) {
>   ...
>   // evil stuff like crash()
>   ...
>   _TestUtil.checkIndex(this)
> }
> {code}
> and for reference DirectoryReader.indexExists is:
> {code}
> try {
>   new SegmentInfos().read(directory);
>   return true;
> } catch (IOException ioe) {
>   return false;
> }
> {code}
> So if there are segments file problems, we just silently do no checkIndex.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to