LUCENE-6271: fix test to fail faster

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene6271@1670508 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-03-31 22:44:11 +00:00
parent 4a1d1c7c31
commit dd0c69cac5
1 changed files with 5 additions and 5 deletions

View File

@ -332,7 +332,7 @@ public abstract class ThreadedIndexingAndSearchingTestCase extends LuceneTestCas
if (VERBOSE) {
System.out.println(Thread.currentThread().getName() + ": launch search thread");
}
while (System.currentTimeMillis() < stopTimeMS) {
while (System.currentTimeMillis() < stopTimeMS && !failed.get()) {
try {
final IndexSearcher s = getCurrentSearcher();
try {
@ -403,8 +403,8 @@ public abstract class ThreadedIndexingAndSearchingTestCase extends LuceneTestCas
searchThreads[thread].start();
}
for(int thread=0;thread<searchThreads.length;thread++) {
searchThreads[thread].join();
for(Thread thread : searchThreads) {
thread.join();
}
if (VERBOSE) {
@ -535,8 +535,8 @@ public abstract class ThreadedIndexingAndSearchingTestCase extends LuceneTestCas
System.out.println("TEST: all searching done [" + (System.currentTimeMillis()-t0) + " ms]");
}
for(int thread=0;thread<indexThreads.length;thread++) {
indexThreads[thread].join();
for(Thread thread : indexThreads) {
thread.join();
}
if (VERBOSE) {