Return-Path: X-Original-To: apmail-lucene-commits-archive@www.apache.org Delivered-To: apmail-lucene-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 69587189B2 for ; Mon, 1 Feb 2016 10:27:09 +0000 (UTC) Received: (qmail 27409 invoked by uid 500); 1 Feb 2016 10:27:09 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 27400 invoked by uid 99); 1 Feb 2016 10:27:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2016 10:27:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EA4BFDFD7D; Mon, 1 Feb 2016 10:27:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mikemccand@apache.org To: commits@lucene.apache.org Message-Id: <6a3dc1fe83ae4d018ed2606b1f3bfcb6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: lucene-solr git commit: fix test bug, using different randomness when creating the two IWCs Date: Mon, 1 Feb 2016 10:27:08 +0000 (UTC) Repository: lucene-solr Updated Branches: refs/heads/master 0fab4ccb9 -> 15fed60b0 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/15fed60b Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/15fed60b Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/15fed60b Branch: refs/heads/master Commit: 15fed60b050c14e09638ebc7d56df99d24631fc6 Parents: 0fab4cc Author: Mike McCandless Authored: Mon Feb 1 05:26:42 2016 -0500 Committer: Mike McCandless Committed: Mon Feb 1 05:27:20 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/15fed60b/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);