You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2015/04/01 02:29:21 UTC
svn commit: r1670525 -
/lucene/dev/branches/lucene6271/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java
Author: rmuir
Date: Wed Apr 1 00:29:21 2015
New Revision: 1670525
URL: http://svn.apache.org/r1670525
Log:
LUCENE-6271: fix another test bug (happens in nightly more often) unrelated to this branch
Modified:
lucene/dev/branches/lucene6271/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java
Modified: lucene/dev/branches/lucene6271/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6271/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java?rev=1670525&r1=1670524&r2=1670525&view=diff
==============================================================================
--- lucene/dev/branches/lucene6271/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java (original)
+++ lucene/dev/branches/lucene6271/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java Wed Apr 1 00:29:21 2015
@@ -28,6 +28,7 @@ import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
@@ -957,12 +958,18 @@ public class TestLRUQueryCache extends L
BadQuery query = new BadQuery();
searcher.count(query);
query.i[0] += 1; // change the hashCode!
+
try {
// trigger an eviction
searcher.count(new MatchAllDocsQuery());
fail();
} catch (ConcurrentModificationException e) {
// expected
+ } catch (RuntimeException e) {
+ // expected: wrapped when executor is in use
+ Throwable cause = e.getCause();
+ assertTrue(cause instanceof ExecutionException);
+ assertTrue(cause.getCause() instanceof ConcurrentModificationException);
}
IOUtils.close(w, reader, dir);