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

Evil up MockDirectoryWrapper.checkIndexOnClose

Details

    • Test
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.6, 4.0-ALPHA
    • None
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: