lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1573522 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/facet/ lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java
Date Mon, 03 Mar 2014 11:10:28 GMT
Author: mikemccand
Date: Mon Mar  3 11:10:28 2014
New Revision: 1573522

URL: http://svn.apache.org/r1573522
Log:
fix this test to sidestep slow config

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/facet/   (props changed)
    lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java

Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java?rev=1573522&r1=1573521&r2=1573522&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java
Mon Mar  3 11:10:28 2014
@@ -35,6 +35,8 @@ import org.apache.lucene.facet.FacetsCon
 import org.apache.lucene.facet.taxonomy.SearcherTaxonomyManager.SearcherAndTaxonomy;
 import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter;
 import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.TieredMergePolicy;
 import org.apache.lucene.search.MatchAllDocsQuery;
 import org.apache.lucene.search.ReferenceManager;
 import org.apache.lucene.store.Directory;
@@ -91,7 +93,7 @@ public class TestSearcherTaxonomyManager
           }
           try {
             w.addDocument(config.build(tw, doc));
-            if (mgr != null && random().nextDouble() < 0.1) {
+            if (mgr != null && random().nextDouble() < 0.02) {
               w.commit();
               tw.commit();
               mgr.maybeRefresh();
@@ -99,7 +101,11 @@ public class TestSearcherTaxonomyManager
           } catch (IOException ioe) {
             throw new RuntimeException(ioe);
           }
-          
+
+          if (VERBOSE) {
+            System.out.println("TW size=" + tw.getSize() + " vs " + ordLimit);
+          }
+
           if (tw.getSize() >= ordLimit) {
             break;
           }
@@ -114,7 +120,16 @@ public class TestSearcherTaxonomyManager
   public void testNRT() throws Exception {
     Directory dir = newDirectory();
     Directory taxoDir = newDirectory();
-    final IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT,
new MockAnalyzer(random())));
+    IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
+    // Don't allow tiny maxBufferedDocs; it can make this
+    // test too slow:
+    iwc.setMaxBufferedDocs(Math.max(500, iwc.getMaxBufferedDocs()));
+
+    // MockRandom/AlcololicMergePolicy are too slow:
+    TieredMergePolicy tmp = new TieredMergePolicy();
+    tmp.setFloorSegmentMB(.001);
+    iwc.setMergePolicy(tmp);
+    final IndexWriter w = new IndexWriter(dir, iwc);
     final DirectoryTaxonomyWriter tw = new DirectoryTaxonomyWriter(taxoDir);
     final FacetsConfig config = new FacetsConfig();
     config.setMultiValued("field", true);
@@ -150,8 +165,11 @@ public class TestSearcherTaxonomyManager
           }
         }
       };
+
+    reopener.setName("reopener");
     reopener.start();
 
+    indexer.setName("indexer");
     indexer.start();
 
     try {



Mime
View raw message