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.