Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-3899

Evil up MockDirectoryWrapper.checkIndexOnClose

    XMLWordPrintableJSON

    Details

    • Type: Test
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      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):

      if (DirectoryReader.indexExists(this) {
        ...
        // evil stuff like crash()
        ...
        _TestUtil.checkIndex(this)
      }
      

      and for reference DirectoryReader.indexExists is:

      try {
        new SegmentInfos().read(directory);
        return true;
      } catch (IOException ioe) {
        return false;
      }
      

      So if there are segments file problems, we just silently do no checkIndex.

        Attachments

        1. LUCENE-3899.patch
          3 kB
          Robert Muir

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rcmuir Robert Muir
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: