You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2021/11/28 15:03:45 UTC

[lucene] branch branch_9x updated: speed up extremely slow test methods (runtime 15-30s) (#471)

This is an automated email from the ASF dual-hosted git repository.

rmuir pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 756550f  speed up extremely slow test methods (runtime 15-30s) (#471)
756550f is described below

commit 756550f88b83a73d6ccfa7b02648ffa1056f8910
Author: Robert Muir <rm...@apache.org>
AuthorDate: Sun Nov 28 09:40:43 2021 -0500

    speed up extremely slow test methods (runtime 15-30s) (#471)
---
 .../simpletext/TestSimpleTextTermVectorsFormat.java      | 16 ++++++++++++++++
 .../lucene/index/TestIndexWriterThreadsToSegments.java   |  2 ++
 .../org/apache/lucene/search/TestSortOptimization.java   |  3 ++-
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextTermVectorsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextTermVectorsFormat.java
index b2ebc21..45719f0 100644
--- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextTermVectorsFormat.java
+++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextTermVectorsFormat.java
@@ -16,8 +16,10 @@
  */
 package org.apache.lucene.codecs.simpletext;
 
+import java.io.IOException;
 import org.apache.lucene.codecs.Codec;
 import org.apache.lucene.index.BaseTermVectorsFormatTestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 public class TestSimpleTextTermVectorsFormat extends BaseTermVectorsFormatTestCase {
   @Override
@@ -29,4 +31,18 @@ public class TestSimpleTextTermVectorsFormat extends BaseTermVectorsFormatTestCa
   protected Codec getCodec() {
     return new SimpleTextCodec();
   }
+
+  // TODO: can we speed up the underlying base test?
+  @Override
+  @LuceneTestCase.Nightly
+  public void testMergeWithIndexSort() throws IOException {
+    super.testMergeWithIndexSort();
+  }
+
+  // TODO: can we speed up the underlying base test?
+  @Override
+  @LuceneTestCase.Nightly
+  public void testMergeWithoutIndexSort() throws IOException {
+    super.testMergeWithoutIndexSort();
+  }
 }
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java
index 78c3f1b..81485d4 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java
@@ -303,6 +303,8 @@ public class TestIndexWriterThreadsToSegments extends LuceneTestCase {
     dir.close();
   }
 
+  // TODO: can we make this test more efficient so it doesn't need to be nightly?
+  @LuceneTestCase.Nightly
   public void testDocsStuckInRAMForever() throws Exception {
     Directory dir = newDirectory();
     IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortOptimization.java b/lucene/core/src/test/org/apache/lucene/search/TestSortOptimization.java
index 3e91135..ff91569 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSortOptimization.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSortOptimization.java
@@ -708,7 +708,8 @@ public class TestSortOptimization extends LuceneTestCase {
     Directory dir = newDirectory();
     IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig());
     List<Long> seqNos = new ArrayList<>();
-    int iterations = 10000 + random().nextInt(10000);
+    int limit = TEST_NIGHTLY ? 10000 : 1000;
+    int iterations = limit + random().nextInt(limit);
     long seqNoGenerator = random().nextInt(1000);
     for (long i = 0; i < iterations; i++) {
       int copies = random().nextInt(100) <= 5 ? 1 : 1 + random().nextInt(5);