fix test bug: this test was not really testing no wait close

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1670284 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-03-31 09:06:08 +00:00
parent 1d26d646cd
commit 51d98e6d88
1 changed files with 5 additions and 2 deletions

View File

@ -217,6 +217,9 @@ public class TestConcurrentMergeScheduler extends LuceneTestCase {
public void testNoWaitClose() throws IOException {
Directory directory = newDirectory();
if (directory instanceof MockDirectoryWrapper) {
((MockDirectoryWrapper) directory).setPreventDoubleWrite(false);
}
Document doc = new Document();
Field idField = newStringField("id", "", Field.Store.YES);
doc.add(idField);
@ -248,7 +251,6 @@ public class TestConcurrentMergeScheduler extends LuceneTestCase {
// stress out aborting them on close:
((LogMergePolicy) writer.getConfig().getMergePolicy()).setMergeFactor(3);
writer.addDocument(doc);
writer.commit();
try {
writer.commit();
@ -267,7 +269,8 @@ public class TestConcurrentMergeScheduler extends LuceneTestCase {
setOpenMode(OpenMode.APPEND).
setMergePolicy(newLogMergePolicy(100)).
// Force excessive merging:
setMaxBufferedDocs(2)
setMaxBufferedDocs(2).
setCommitOnClose(false)
);
}
writer.close();