You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2019/06/11 09:19:48 UTC

[lucene-solr] 01/02: LUCENE-8815: Ensure single segments in tests

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

romseygeek pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit a66fe5f777afe8fa291a5e9bdd5323e31819acee
Author: Alan Woodward <ro...@apache.org>
AuthorDate: Tue Jun 11 09:40:00 2019 +0100

    LUCENE-8815: Ensure single segments in tests
---
 .../lucene/document/TestFeatureDoubleValues.java       | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/lucene/core/src/test/org/apache/lucene/document/TestFeatureDoubleValues.java b/lucene/core/src/test/org/apache/lucene/document/TestFeatureDoubleValues.java
index 5640d18..efdd04e 100644
--- a/lucene/core/src/test/org/apache/lucene/document/TestFeatureDoubleValues.java
+++ b/lucene/core/src/test/org/apache/lucene/document/TestFeatureDoubleValues.java
@@ -27,21 +27,6 @@ import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 
-/*
- * Test for retrieving values from a feature using a FeatureDoubleValuesSource.
- *
- * THE RULES:
- * 1. keywords like 'abstract' and 'static' should not appear in this file.
- * 2. each test method should be self-contained and understandable.
- * 3. no test methods should share code with other test methods.
- * 4. no testing of things unrelated to sorting.
- * 5. no tracers.
- * 6. keyword 'class' should appear only once in this file, here ----
- *                                                                  |
- *        -----------------------------------------------------------
- *        |
- *       \./
- */
 public class TestFeatureDoubleValues extends LuceneTestCase {
 
   public void testFeature() throws IOException {
@@ -56,6 +41,7 @@ public class TestFeatureDoubleValues extends LuceneTestCase {
     doc = new Document();
     doc.add(new FeatureField("field", "name", 4F));
     writer.addDocument(doc);
+    writer.forceMerge(1);
     IndexReader ir = writer.getReader();
     writer.close();
 
@@ -87,6 +73,7 @@ public class TestFeatureDoubleValues extends LuceneTestCase {
     doc = new Document();
     doc.add(new FeatureField("field", "name", 4F));
     writer.addDocument(doc);
+    writer.forceMerge(1);
     IndexReader ir = writer.getReader();
     writer.close();
 
@@ -168,6 +155,7 @@ public class TestFeatureDoubleValues extends LuceneTestCase {
     doc = new Document();
     doc.add(new FeatureField("field", "name", 4F));
     writer.addDocument(doc);
+    writer.forceMerge(1);
     IndexReader ir = writer.getReader();
     writer.close();