From 14f4e0475deba56a4c07a0b148eee7c6844c7650 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Fri, 10 Dec 2010 09:52:30 +0000 Subject: [PATCH] fix false test failure git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1044257 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/lucene/index/TestNRTThreads.java | 129 ++++++++++-------- 1 file changed, 69 insertions(+), 60 deletions(-) diff --git a/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java b/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java index b4bc6a81086..a10983ef579 100644 --- a/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java +++ b/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java @@ -48,6 +48,7 @@ import static org.junit.Assume.*; // TODO // - mix in optimize, addIndexes +// - randomoly mix in non-congruent docs public class TestNRTThreads extends LuceneTestCase { @@ -216,71 +217,79 @@ public class TestNRTThreads extends LuceneTestCase { smokeTestReader(r); - final IndexSearcher s = new IndexSearcher(r); + if (r.numDocs() > 0) { - // run search threads - final long searchStopTime = System.currentTimeMillis() + 500; - final Thread[] searchThreads = new Thread[NUM_SEARCH_THREADS]; - final AtomicInteger totHits = new AtomicInteger(); - for(int thread=0;thread