IndexReader reader = IndexReader.open(dir, true);
reader.close();
fileName = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
"",
gen);
long modTime = dir.fileModified(fileName);
assertTrue("commit point was older than " + SECONDS + " seconds (" + (lastDeleteTime - modTime) + " msec) but did not get deleted", lastDeleteTime - modTime <= (SECONDS*1000));
} catch (IOException e) {
// OK
break;
}