You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2021/11/24 07:33:48 UTC

[lucene] branch branch_9x updated (1701371 -> b3a3616)

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

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


    from 1701371  LUCENE-10200: fix luke lauch script.
     new 3f634e2  LUCENE-10168: Only test N-2 codecs on nightly runs.
     new b3a3616  Speed up TestBackwardsCompatibility#testCommandLineArgs. (#467)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 dev-tools/scripts/smokeTestRelease.py              |  6 ++++++
 .../lucene70/TestLucene70DocValuesFormat.java      |  2 ++
 .../lucene70/TestLucene70NormsFormat.java          |  2 ++
 .../backward_index/TestBackwardsCompatibility.java | 25 +++++++++++++++-------
 .../lucene/index/BaseCompoundFormatTestCase.java   |  1 +
 5 files changed, 28 insertions(+), 8 deletions(-)

[lucene] 02/02: Speed up TestBackwardsCompatibility#testCommandLineArgs. (#467)

Posted by jp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b3a36166a531231ef6bfb3b90418c4bf2270a775
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Wed Nov 24 08:25:22 2021 +0100

    Speed up TestBackwardsCompatibility#testCommandLineArgs. (#467)
    
    This test unzip files that we already unzipped. This commit copies the already
    uncompressed files instead.
---
 .../lucene/backward_index/TestBackwardsCompatibility.java    | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
index 11f69688..54922ad 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
@@ -106,6 +106,7 @@ import org.apache.lucene.store.BaseDirectoryWrapper;
 import org.apache.lucene.store.ByteBuffersDirectory;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.NIOFSDirectory;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
@@ -1664,17 +1665,22 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
     }
   }
 
-  public void testCommandLineArgs() throws Exception {
+  public void testIndexUpgraderCommandLineArgs() throws Exception {
 
     PrintStream savedSystemOut = System.out;
     System.setOut(new PrintStream(new ByteArrayOutputStream(), false, "UTF-8"));
     try {
       for (Map.Entry<String, Directory> entry : oldIndexDirs.entrySet()) {
         String name = entry.getKey();
+        Directory origDir = entry.getValue();
         int indexCreatedVersion =
-            SegmentInfos.readLatestCommit(entry.getValue()).getIndexCreatedVersionMajor();
+            SegmentInfos.readLatestCommit(origDir).getIndexCreatedVersionMajor();
         Path dir = createTempDir(name);
-        TestUtil.unzip(getDataInputStream("index." + name + ".zip"), dir);
+        try (FSDirectory fsDir = FSDirectory.open(dir)) {
+          for (String file : origDir.listAll()) {
+            fsDir.copyFrom(origDir, file, file, IOContext.DEFAULT);
+          }
+        }
 
         String path = dir.toAbsolutePath().toString();
 

[lucene] 01/02: LUCENE-10168: Only test N-2 codecs on nightly runs.

Posted by jp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3f634e2ab90f55d0d79472608bf7f74644551548
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Tue Nov 23 09:12:59 2021 +0100

    LUCENE-10168: Only test N-2 codecs on nightly runs.
    
    In order for tests to keep running fast, this annotates all tests of N-2 codecs
    with `@Nightly`. To keep good coverage of releases, the smoke tester is now
    configured to run nightly tests.
---
 dev-tools/scripts/smokeTestRelease.py                       |  6 ++++++
 .../lucene70/TestLucene70DocValuesFormat.java               |  2 ++
 .../backward_codecs/lucene70/TestLucene70NormsFormat.java   |  2 ++
 .../lucene/backward_index/TestBackwardsCompatibility.java   | 13 ++++++++-----
 .../org/apache/lucene/index/BaseCompoundFormatTestCase.java |  1 +
 5 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py
index 4e98dd4..04bfc13 100755
--- a/dev-tools/scripts/smokeTestRelease.py
+++ b/dev-tools/scripts/smokeTestRelease.py
@@ -1129,6 +1129,12 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys,
   # disable flakey tests for smoke-tester runs:
   testArgs = '-Dtests.badapples=false %s' % testArgs
 
+  # Tests annotated @Nightly are more resource-intensive but often cover
+  # important code paths. They're disabled by default to preserve a good
+  # developer experience, but we enable them for smoke tests where we want good
+  # coverage.
+  testArgs = '-Dtests.nigthly=true %s' % testArgs
+
   if FORCE_CLEAN:
     if os.path.exists(tmpDir):
       raise RuntimeError('temp dir %s exists; please remove first' % tmpDir)
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java
index 894b2c1..d56ded6 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java
@@ -66,9 +66,11 @@ import org.apache.lucene.store.ByteBuffersDataOutput;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.BytesRefBuilder;
+import org.apache.lucene.util.LuceneTestCase.Nightly;
 import org.apache.lucene.util.TestUtil;
 
 /** Tests Lucene70DocValuesFormat */
+@Nightly // N-2 formats are only tested on nightly runs
 public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatTestCase {
   private final Codec codec = TestUtil.alwaysDocValuesFormat(new Lucene70DocValuesFormat());
 
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70NormsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70NormsFormat.java
index 5530235..2c503a4 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70NormsFormat.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70NormsFormat.java
@@ -18,8 +18,10 @@ package org.apache.lucene.backward_codecs.lucene70;
 
 import org.apache.lucene.codecs.Codec;
 import org.apache.lucene.index.BaseNormsFormatTestCase;
+import org.apache.lucene.util.LuceneTestCase.Nightly;
 
 /** Tests Lucene70NormsFormat */
+@Nightly // N-2 formats are only tested on nightly runs
 public class TestLucene70NormsFormat extends BaseNormsFormatTestCase {
   @Override
   protected Codec getCodec() {
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
index 2962293..11f69688 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
@@ -1037,11 +1037,13 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
       searchIndex(oldIndexDirs.get(name), name, Version.MIN_SUPPORTED_MAJOR);
     }
 
-    for (String name : binarySupportedNames) {
-      Path oldIndexDir = createTempDir(name);
-      TestUtil.unzip(getDataInputStream("unsupported." + name + ".zip"), oldIndexDir);
-      try (BaseDirectoryWrapper dir = newFSDirectory(oldIndexDir)) {
-        searchIndex(dir, name, MIN_BINARY_SUPPORTED_MAJOR);
+    if (TEST_NIGHTLY) {
+      for (String name : binarySupportedNames) {
+        Path oldIndexDir = createTempDir(name);
+        TestUtil.unzip(getDataInputStream("unsupported." + name + ".zip"), oldIndexDir);
+        try (BaseDirectoryWrapper dir = newFSDirectory(oldIndexDir)) {
+          searchIndex(dir, name, MIN_BINARY_SUPPORTED_MAJOR);
+        }
       }
     }
   }
@@ -2096,6 +2098,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
     }
   }
 
+  @Nightly
   public void testReadNMinusTwoCommit() throws IOException {
     for (String name : binarySupportedNames) {
       Path oldIndexDir = createTempDir(name);
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
index cb20755..46fab1c 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
@@ -165,6 +165,7 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
   }
 
   // LUCENE-5724: actually test we play nice with NRTCachingDir and massive file
+  @Slow
   public void testLargeCFS() throws IOException {
     final String testfile = "_123.test";
     IOContext context = new IOContext(new FlushInfo(0, 512 * 1024 * 1024));