You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2016/02/01 11:26:30 UTC

lucene-solr git commit: fix test bug, using different randomness when creating the two IWCs

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_5x 5e758d269 -> 69d9c17a2


fix test bug, using different randomness when creating the two IWCs


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/69d9c17a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/69d9c17a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/69d9c17a

Branch: refs/heads/branch_5x
Commit: 69d9c17a2c37f55bd63571f5768cb5139834d7a8
Parents: 5e758d2
Author: Mike McCandless <mi...@apache.org>
Authored: Mon Feb 1 05:26:42 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Mon Feb 1 05:26:42 2016 -0500

----------------------------------------------------------------------
 .../org/apache/lucene/index/TestSwappedIndexFiles.java  | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/69d9c17a/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java b/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java
index a9a8c14..c412545 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java
@@ -19,6 +19,7 @@ package org.apache.lucene.index;
 
 import java.io.EOFException;
 import java.io.IOException;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Random;
 
@@ -70,7 +71,7 @@ public class TestSwappedIndexFiles extends LuceneTestCase {
 
   private void indexOneDoc(long seed, Directory dir, Document doc, boolean useCFS) throws IOException {
     Random random = new Random(seed);
-    IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random));
+    IndexWriterConfig conf = newIndexWriterConfig(random, new MockAnalyzer(random));
     conf.setCodec(TestUtil.getDefaultCodec());
 
     if (useCFS == false) {
@@ -87,6 +88,10 @@ public class TestSwappedIndexFiles extends LuceneTestCase {
   }
   
   private void swapFiles(Directory dir1, Directory dir2) throws IOException {
+    if (VERBOSE) {
+      System.out.println("TEST: dir1 files: " + Arrays.toString(dir1.listAll()));
+      System.out.println("TEST: dir2 files: " + Arrays.toString(dir2.listAll()));
+    }
     for(String name : dir1.listAll()) {
       if (name.equals(IndexWriter.WRITE_LOCK_NAME)) {
         continue;
@@ -94,8 +99,11 @@ public class TestSwappedIndexFiles extends LuceneTestCase {
       swapOneFile(dir1, dir2, name);
     }
   }
-  
+
   private void swapOneFile(Directory dir1, Directory dir2, String victim) throws IOException {
+    if (VERBOSE) {
+      System.out.println("TEST: swap file " + victim);
+    }
     try (BaseDirectoryWrapper dirCopy = newDirectory()) {
       dirCopy.setCheckIndexOnClose(false);