lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r1377397 - in /lucene/dev/trunk/lucene: core/src/test/org/apache/lucene/index/ misc/src/test/org/apache/lucene/index/
Date Sun, 26 Aug 2012 09:31:41 GMT
Author: uschindler
Date: Sun Aug 26 09:31:40 2012
New Revision: 1377397

URL: http://svn.apache.org/viewvc?rev=1377397&view=rev
Log:
Fix more test to not fail when rarely() selects a maximum segment size

Modified:
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
    lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java?rev=1377397&r1=1377396&r2=1377397&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java Sun
Aug 26 09:31:40 2012
@@ -1106,10 +1106,11 @@ public class TestAddIndexes extends Luce
     IndexReader[] readers = new IndexReader[] { DirectoryReader.open(dirs[0]), DirectoryReader.open(dirs[1])
};
     
     Directory dir = new MockDirectoryWrapper(random(), new RAMDirectory());
-    IndexWriterConfig conf = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy());
+    IndexWriterConfig conf = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy(true));
     LogMergePolicy lmp = (LogMergePolicy) conf.getMergePolicy();
-    lmp.setUseCompoundFile(true);
-    lmp.setNoCFSRatio(1.0); // Force creation of CFS
+    // Force creation of CFS:
+    lmp.setNoCFSRatio(1.0);
+    lmp.setMaxCFSSegmentSizeMB(Double.POSITIVE_INFINITY);
     IndexWriter w3 = new IndexWriter(dir, conf);
     w3.addIndexes(readers);
     w3.close();

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java?rev=1377397&r1=1377396&r2=1377397&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
(original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
Sun Aug 26 09:31:40 2012
@@ -510,6 +510,7 @@ public class TestBackwardsCompatibility 
     LogByteSizeMergePolicy mp = new LogByteSizeMergePolicy();
     mp.setUseCompoundFile(doCFS);
     mp.setNoCFSRatio(1.0);
+    mp.setMaxCFSSegmentSizeMB(Double.POSITIVE_INFINITY);
     // TODO: remove randomness
     IndexWriterConfig conf = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()))
       .setMaxBufferedDocs(10).setMergePolicy(mp);

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java?rev=1377397&r1=1377396&r2=1377397&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
(original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
Sun Aug 26 09:31:40 2012
@@ -45,7 +45,10 @@ public class TestIndexFileDeleter extend
     }
 
     LogMergePolicy mergePolicy = newLogMergePolicy(true, 10);
-    mergePolicy.setNoCFSRatio(1); // This test expects all of its segments to be in CFS
+    
+    // This test expects all of its segments to be in CFS
+    mergePolicy.setNoCFSRatio(1.0);
+    mergePolicy.setMaxCFSSegmentSizeMB(Double.POSITIVE_INFINITY);
 
     IndexWriter writer = new IndexWriter(
         dir,

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=1377397&r1=1377396&r2=1377397&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java Sun
Aug 26 09:31:40 2012
@@ -1275,7 +1275,10 @@ public class TestIndexWriter extends Luc
       Directory dir = newMockDirectory(); // relies on windows semantics
 
       LogMergePolicy mergePolicy = newLogMergePolicy(true);
-      mergePolicy.setNoCFSRatio(1); // This test expects all of its segments to be in CFS
+      
+      // This test expects all of its segments to be in CFS
+      mergePolicy.setNoCFSRatio(1.0);
+      mergePolicy.setMaxCFSSegmentSizeMB(Double.POSITIVE_INFINITY);
 
       IndexWriter w = new IndexWriter(
           dir,

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java?rev=1377397&r1=1377396&r2=1377397&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
(original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
Sun Aug 26 09:31:40 2012
@@ -331,15 +331,15 @@ public class TestIndexWriterConfig exten
   public void testLiveChangeToCFS() throws Exception {
     Directory dir = newDirectory();
     IndexWriterConfig iwc = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
-    iwc.setMergePolicy(newLogMergePolicy());
+    iwc.setMergePolicy(newLogMergePolicy(true));
 
     // Start false:
     ((LogMergePolicy) iwc.getMergePolicy()).setUseCompoundFile(false); 
     IndexWriter w = new IndexWriter(dir, iwc);
 
-    // Change to true:
-    ((LogMergePolicy) w.getConfig().getMergePolicy()).setNoCFSRatio(1.0);
-    ((LogMergePolicy) w.getConfig().getMergePolicy()).setUseCompoundFile(true);
+    LogMergePolicy lmp = ((LogMergePolicy) w.getConfig().getMergePolicy());
+    lmp.setNoCFSRatio(1.0);
+    lmp.setMaxCFSSegmentSizeMB(Double.POSITIVE_INFINITY);
 
     Document doc = new Document();
     doc.add(newStringField("field", "foo", Store.NO));

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java?rev=1377397&r1=1377396&r2=1377397&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
(original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
Sun Aug 26 09:31:40 2012
@@ -1134,7 +1134,10 @@ public class TestIndexWriterExceptions e
                               newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())).
                               setMergePolicy(newLogMergePolicy(true))
                               );
-    ((LogMergePolicy) writer.getConfig().getMergePolicy()).setNoCFSRatio(1.0);
+    LogMergePolicy lmp = (LogMergePolicy) writer.getConfig().getMergePolicy();
+    // Force creation of CFS:
+    lmp.setNoCFSRatio(1.0);
+    lmp.setMaxCFSSegmentSizeMB(Double.POSITIVE_INFINITY);
 
     // add 100 documents
     for (int i = 0; i < 100; i++) {

Modified: lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java?rev=1377397&r1=1377396&r2=1377397&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java (original)
+++ lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java Sun
Aug 26 09:31:40 2012
@@ -36,7 +36,8 @@ public class TestIndexSplitter extends L
     Directory fsDir = newFSDirectory(dir);
 
     LogMergePolicy mergePolicy = new LogByteSizeMergePolicy();
-    mergePolicy.setNoCFSRatio(1);
+    mergePolicy.setNoCFSRatio(1.0);
+    mergePolicy.setMaxCFSSegmentSizeMB(Double.POSITIVE_INFINITY);
     IndexWriter iw = new IndexWriter(
         fsDir,
         new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())).



Mime
View raw message