diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java b/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java index 8123addab84..075e62d59c8 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java @@ -19,6 +19,7 @@ package org.apache.lucene.search; import java.util.Arrays; +import java.util.Collections; import java.util.Random; import org.apache.lucene.analysis.MockAnalyzer; @@ -106,6 +107,7 @@ public class TestBoolean2 extends LuceneTestCase { for (String fileName : directory.listAll()) { singleSegmentDirectory.copyFrom(directory, fileName, fileName, IOContext.DEFAULT); + singleSegmentDirectory.sync(Collections.singleton(fileName)); } IndexWriterConfig iwc = newIndexWriterConfig(new MockAnalyzer(random()));