[
https://issues.apache.org/jira/browse/LUCENE-3899?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Muir updated LUCENE-3899:
--------------------------------
Attachment: LUCENE-3899.patch
attached is a patch:
I had to disable checkIndexOnClose for
TestBackwardsCompatibility.testUnsupportedOldIndexes (because we intentionally
don't want to checkIndex() them, it will now fail).
I think its ready to commit.
> 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: [email protected]
For additional commands, e-mail: [email protected]