diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java index fbd89233fe3..9f53ab823ce 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java @@ -1352,6 +1352,9 @@ public class TestIndexWriter extends LuceneTestCase { List files = new ArrayList(Arrays.asList(dir.listAll())); + // RAMDir won't have a write.lock, but fs dirs will: + files.remove("write.lock"); + assertTrue(files.contains("_0.cfs")); assertTrue(files.contains("_0.cfe")); assertTrue(files.contains("_0.si")); @@ -1363,8 +1366,6 @@ public class TestIndexWriter extends LuceneTestCase { } else { // this is an NRT reopen - no segments files yet - // RAMDir won't have a write.lock, but fs dirs will: - files.remove("write.lock"); assertEquals(files.toString(), files.size(), 3); } w.addDocument(doc);