lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [09/31] lucene-solr:jira/http2: LUCENE-8442: Avoid merge in testPendingDeleteDVGeneration
Date Fri, 10 Aug 2018 09:13:49 GMT
LUCENE-8442: Avoid merge in testPendingDeleteDVGeneration

If a merge is triggered, it might reclaim the randomFile which we picked
up but haven't opened yet, the test will fail with NoSuchFileException.
This commit disables merges to avoid such scenarios.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/38986531
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/38986531
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/38986531

Branch: refs/heads/jira/http2
Commit: 3898653195b24987b8ba53ea9acf8713316b66f3
Parents: 208d59b
Author: Nhat Nguyen <nhat.nguyen@elastic.co>
Authored: Tue Aug 7 08:39:46 2018 -0400
Committer: Nhat Nguyen <nhat.nguyen@elastic.co>
Committed: Tue Aug 7 09:19:56 2018 -0400

----------------------------------------------------------------------
 lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38986531/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
----------------------------------------------------------------------
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 b640298..08b3dc1 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
@@ -2664,6 +2664,7 @@ public class TestIndexWriter extends LuceneTestCase {
          Closeable closeable = () -> IOUtils.close(toClose)) {
       IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()))
           .setUseCompoundFile(false)
+          .setMergePolicy(NoMergePolicy.INSTANCE) // avoid merging away the randomFile
           .setMaxBufferedDocs(2)
           .setRAMBufferSizeMB(-1);
       IndexWriter w = new IndexWriter(dir, iwc);
@@ -2702,6 +2703,7 @@ public class TestIndexWriter extends LuceneTestCase {
         w.rollback();
         iwc = new IndexWriterConfig(new MockAnalyzer(random()))
             .setUseCompoundFile(false)
+            .setMergePolicy(NoMergePolicy.INSTANCE)
             .setMaxBufferedDocs(2)
             .setRAMBufferSizeMB(-1);
         w = new IndexWriter(dir, iwc);


Mime
View raw message